stratEst.data {stratEst} | R Documentation |
Creates a stratEst.data object.
Description
Creates a stratEst.data object.
Usage
stratEst.data(
data,
choice = "choice",
input = c("input"),
input.lag = 0,
input.sep = "",
id = "id",
game = "game",
period = "period",
add = NULL,
drop = NULL
)
Arguments
data |
a |
choice |
a character string. The variable in |
input |
a character string. The names of the input generating variables in |
input.lag |
a numeric vector. The time lag in periods of the input generating variables. An integer or a vector of integers with as many elements as variables specified in the object |
input.sep |
a character string. Separates the input generating variables. Default is |
id |
a character string. The name of the variable in |
game |
a character string. The name of the variable in |
period |
a character string. The name of the variable in |
add |
a character vector. The names of variables in the global environment that should be added to the |
drop |
a character vector. The names of variables in |
Details
The data generation function of the package.
Value
A stratEst.data
object. A data frame in the long format with the following variables:
id |
the variable that identifies observations of the same individual. |
game |
the variable that identifies observations of the same game. |
period |
the period of the game. |
choice |
the discrete choices. |
input |
the inputs. |
Examples
## Transform the prisoner's dilemma data of Dal Bo and Frechette (2011).
data.DF2011 <- stratEst.data(DF2011, choice = "choice",
input=c("choice", "other.choice"), input.lag = 1)
## Transform the prisoner's dilemma data of Fudenberg, Rand, and Dreber (2012).
data.FRD2012 <- stratEst.data(data = FRD2012, choice = "choice",
input = c("last.choice", "last.other"))