View source: R/stratEst_data.R
stratEst.data | R Documentation |
Creates a stratEst.data object.
stratEst.data( data, choice = "choice", input = c("input"), input.lag = 0, input.sep = "", id = "id", game = "game", period = "period", add = NULL, drop = NULL )
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 |
The data generation function of the package.
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. |
## 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"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.