Title: | Strategy Estimation |
---|---|
Description: | Variants of strategy estimation (Dal Bo & Frechette, 2011, <doi:10.1257/aer.101.1.411>), including the model with parameters for the choice probabilities of the strategies (Breitmoser, 2015, <doi:10.1257/aer.20130675>), and the model with individual level covariates for the selection of strategies by individuals (Dvorak & Fehrler, 2018, <doi:10.2139/ssrn.2986445>). |
Authors: | Fabian Dvorak |
Maintainer: | Fabian Dvorak <[email protected]> |
License: | GPL-3 |
Version: | 1.1.6 |
Built: | 2024-10-30 06:54:08 UTC |
Source: | CRAN |
The dataset of Dal Bo and Frechette (DF2011, 2011) as stratEst.data frame.
data(data.DF2011)
data(data.DF2011)
A data frame with 7358 rows and 7 variables:
A treatment identifier of the experiment.
Variable which identifies a participant.
The supergame number.
The period of the supergame.
A factor with two levels which is indicates if the participant cooperates (c) or defects (d) in the current period.
A factor with two levels which indicates if the other participant cooperates (c) or defects (d) in the current period.
A factor with four levels which is indicates the action profile in the previous round. The first letter indicates the action of the participant, the second letter the action of the partner in the previous round. In the first round of a game the input is NA.
https://www.aeaweb.org/articles?id=10.1257/aer.101.1.411
Dal Bo P, Frechette GR (2011). "The Evolution of Cooperation in Infinitely Repeated Games: Experimental Evidence." American Economic Review, 101(1), 411-429.
A stratEst.data object with observations from an experiment on social influence.
data(data.DF2011)
data(data.DF2011)
A data frame with 569 rows and 8 variables:
A vector of integers which identifies the participant.
A vector of integers which identifies the game.
A vector of integers which identifies the period.
A factor with two levels which indicates if the choices of the other two group members are in line (in line) or not in line (not in line) with the preference of the participant.
A factor with two levels which is indicates if the participant deviates (deviate) from or follows (follow) the own preference in the current period.
An intercept. One for every observation.
The conformity score of the participant in a post-experimental conformity questionnaire (Mehrabian and Stefl, 1995).
A factor which indicates the input for the strategies. The variable choice with two levels which is indicates if the participant deviates (deviate) from or follows (follow) the own preference in the current period.
Dvorak F, Fischbacher U, Schmelz K (2020). "Incentives for Conformity and Anticonformity." TWI Working Paper Series.
Mehrabian A, Stefl CA (1995). "Basic Temperament Components of Loneliness, Shyness, and Conformity." Social Behavior and Personality, 23(3), 253–263.
The dataset of Fudenberg, Rand, and Dreber (2012) as stratEst.data frame.
data(data.FRD2012)
data(data.FRD2012)
A data frame with 13126 rows and 10 variables:
A factor with six levels which identifies the treatments of the experiment.
A vector of integers which identifies the participant.
A vector of integers which identifies the supergame.
A vector of integers which identifies the period of the supergame.
A factor with two levels which is indicates if the participant cooperates (c) or defects (d) in the current period.
A factor with two levels which indicates if the participant cooperated (c) or defected (d) in the previous period.
A factor with two levels which indicates if the other participant cooperated (c) or defected (d) in the previous period.
A factor which indicates the benefit to cost ratio of the treatment.
A factor which indicates the noise level of the treatment.
A factor with four levels which is indicates the action profile in the previous round. The first letter indicates the action of the participant, the second letter the action of the partner in the previous round. In the first round of a game the input is NA.
https://www.aeaweb.org/articles?id=10.1257/aer.102.2.720
Fudenberg D, Rand DG, Dreber A (2012). "Slow to Anger and Fast to Forgive: Cooperation in an Uncertain World." American Economic Review, 102(2), 720-749.
A stratEst.data object that contains the data of Wang, Xu, and Zhou (2014).
data(data.WXZ2014)
data(data.WXZ2014)
A stratEst.data object with 21.600 rows and 7 variables:
Variable which identifies the participant.
The identifier of the game.
The period within the game.
A factor with three levels which indicates if the player chooses rock, paper or scissors.
A factor with three levels which indicates if the other player chooses rock, paper or scissors.
A factor with three levels which indicates if the result for the player.
A factor with three levels which is indicates the action in the previous round. In the first period of a game the input is NA.
Wang Z, Xu B, Zhou HJ (2014). "Social Cycling and Conditional Responses in the Rock-Paper-Scissors Game." Scientific Reports, 4(1), 2045-2322.
A dataset with observations from the repeated prisoner's dilemma experiment of Dal Bo and Frechette (2011).
data(DF2011)
data(DF2011)
A data frame with 7358 rows and 6 variables:
A factor with six levels which identifies the treatments of the experiment.
A vector of integers which identifies the participant.
A vector of integers which identifies the supergame.
A vector of integers which identifies the period of the supergame.
A factor with two levels which is indicates if the participant cooperates (c) or defects (d) in the current period.
A factor with two levels which indicates if the other participant cooperates (c) or defects (d) in the current period.
https://www.aeaweb.org/articles?id=10.1257/aer.101.1.411
Dal Bo P, Frechette GR (2011). "The Evolution of Cooperation in Infinitely Repeated Games: Experimental Evidence." American Economic Review, 101(1), 411-429.
A dataset with observations from an experiment on social influence.
data(DF2011)
data(DF2011)
A data frame with 569 rows and 7 variables:
A vector of integers which identifies the participant.
A vector of integers which identifies the game.
A vector of integers which identifies the period.
A factor with two levels which indicates if the choices of the other two group members are in line (in line) or not in line (not in line) with the preference of the participant.
A factor with two levels which is indicates if the participant deviates (deviate) from or follows (follow) the own preference in the current period.
An intercept. One for every observation.
The conformity score of the participant in a post-experimental conformity questionnaire (Mehrabian and Stefl, 1995).
Dvorak F, Fischbacher U, Schmelz K (2020). "Incentives for Conformity and Anticonformity." TWI Working Paper Series.
Mehrabian A, Stefl CA (1995). "Basic Temperament Components of Loneliness, Shyness, and Conformity." Social Behavior and Personality, 23(3), 253–263.
A dataset with observations from the repeated prisoner's dilemma experiment of Fudenberg, Rand, and Dreber (2012).
data(FRD2012)
data(FRD2012)
A data frame with 13126 rows and 9 variables:
A factor with six levels which identifies the treatments of the experiment.
A vector of integers which identifies the participant.
A vector of integers which identifies the supergame.
A vector of integers which identifies the period of the supergame.
A factor with two levels which is indicates if the participant cooperates (c) or defects (d) in the current period.
A factor with two levels which indicates if the participant cooperated (c) or defected (d) in the previous period.
A factor with two levels which indicates if the other participant cooperated (c) or defected (d) in the previous period.
A factor which indicates the benefit to cost ratio of the treatment.
A factor which indicates the noise level of the treatment.
https://www.aeaweb.org/articles?id=10.1257/aer.102.2.720
Fudenberg D, Rand DG, Dreber A (2012). "Slow to Anger and Fast to Forgive: Cooperation in an Uncertain World." American Economic Review, 102(2), 720-749.
Checks if an object is of class stratEst.check
.
is.stratEst.check(x)
is.stratEst.check(x)
x |
object to be tested. |
Objects of class stratEst.check
are returned by the function stratEst.check()
of package stratEst
.
is.stratEst.check
returns TRUE
if its argument is a stratEst.check
object (that is, has "stratEst.check" amongst its classes) and FALSE
otherwise.
Checks if an object is of class stratEst.data
.
is.stratEst.data(x)
is.stratEst.data(x)
x |
object to be tested. |
Objects of class stratEst.data
are returned by the functions stratEst.data()
and stratEst.simulate()
of package stratEst
.
is.stratEst.data
returns TRUE
if its argument is a stratEst.data
object (that is, has "stratEst.data" amongst its classes) and FALSE
otherwise.
Checks if an object is of class stratEst.model
.
is.stratEst.model(x)
is.stratEst.model(x)
x |
object to be tested. |
Objects of class stratEst.model
are returned by the estimation function stratEst.model()
of package stratEst
.
is.stratEst.model
returns TRUE
if its argument is a stratEst.model
object (that is, has "stratEst.model" amongst its classes) and FALSE
otherwise.
Checks if an object is of class stratEst.strategy
.
is.stratEst.strategy(x)
is.stratEst.strategy(x)
x |
object to be tested. |
Objects of class stratEst.strategy
is returned by the function stratEst.strategy()
of package stratEst
.
is.stratEst.strategy
returns TRUE
if its argument is a stratEst.strategy
object (that is, has "stratEst.strategy" amongst its classes) and FALSE
otherwise.
Plot Method for stratEst.strategy
## S3 method for class 'stratEst.strategy' plot( x, y, ..., title = NULL, show.legend = TRUE, show.title = TRUE, node.fontsize = 25, main.fontsize = 40, arrow.fontsize = 20, legend.fontsize = 20, legend.width = 1, node.width = 1, arrowsize = 1, node.penwidth = 1, arrow.penwidth = 1, fillcolor = NULL, ranksep = 0, file = NA )
## S3 method for class 'stratEst.strategy' plot( x, y, ..., title = NULL, show.legend = TRUE, show.title = TRUE, node.fontsize = 25, main.fontsize = 40, arrow.fontsize = 20, legend.fontsize = 20, legend.width = 1, node.width = 1, arrowsize = 1, node.penwidth = 1, arrow.penwidth = 1, fillcolor = NULL, ranksep = 0, file = NA )
x |
An object of class |
y |
Argument two of the generic function. |
... |
Further arguments passed to or from other methods. |
title |
String. The title of the plot. |
show.legend |
Logical. Hide plot legend if FALSE. Default is TRUE. |
show.title |
Logical. Hide plot title if FALSE. Default is TRUE. |
node.fontsize |
Font-size of the plot labels. |
main.fontsize |
Font-size of the plot title. |
arrow.fontsize |
Font-size of the arrow labels. |
legend.fontsize |
Font-size of the legend. |
legend.width |
Width of the legend items. |
node.width |
Width of the nodes. |
arrowsize |
Size of the arrowhead. |
node.penwidth |
Width of the nodes. |
arrow.penwidth |
Width of the nodes. |
fillcolor |
Vector of hex-color codes of the choices. |
ranksep |
Separation of nodes with the same rank. |
file |
String. A valid path followed by a file name. Should end with .svg. Default is NA and no file is written. |
No return value, called to create a plot.
Print Method for stratEst.check
## S3 method for class 'stratEst.check' print(x, ...)
## S3 method for class 'stratEst.check' print(x, ...)
x |
An object of class |
... |
Further arguments passed to or from other methods. |
Prints a matrix
that contains the log-likelihood, the number of free model parameters, and the values of three information criteria in columns.
Print Method for stratEst.data
## S3 method for class 'stratEst.data' print(x, ...)
## S3 method for class 'stratEst.data' print(x, ...)
x |
An object of class |
... |
Further arguments passed to or from other methods. |
Prints a data.frame
object that contains the data.
Print Method for stratEst.model
## S3 method for class 'stratEst.model' print(x, ...)
## S3 method for class 'stratEst.model' print(x, ...)
x |
An object of class |
... |
Further arguments passed to or from other methods. |
No return value, prints a summary of the model to the console.
Print Method for stratEst.strategy
## S3 method for class 'stratEst.strategy' print(x, ...)
## S3 method for class 'stratEst.strategy' print(x, ...)
x |
An object of class |
... |
Further arguments passed to or from other methods. |
No return value, prints a summary of the strategy to the console.
Round Method for stratEst.strategy
## S3 method for class 'stratEst.strategy' round(x, digits = 0)
## S3 method for class 'stratEst.strategy' round(x, digits = 0)
x |
An object of class |
digits |
Further arguments passed to or from other methods. |
A stratEst.strategy
object with rounded variable values. A data.frame with the following variables:
prob.x |
the probability of choice |
tremble |
the probability to observe a tremble. |
tr(x) |
the deterministic state transitions of the strategy for input |
List of six prisoner's dilemma strategies (Dal Bo and Frechette 2011).
data(strategies.DF2011)
data(strategies.DF2011)
Each strategy is encoded as a data.frame object. The rows of the data frame represent the states of the automaton. The first row is the start state of the automaton. Each data.frame object contains the following variables:
prob.d
Probability to defect.
prob.c
Probability to cooperate.
tremble
Probability of a tremble.
tr(cc)
State transition for the input cc.
tr(cd)
State transition for the input cd.
tr(dc)
State transition for the input dc.
tr(dd)
State transition for the input dd.
The prisoner's dilemma strategies are:
Strategy which always defects.
Strategy which always cooperates.
Strategy which cooperates until one player defects, then GRIM defects forever.
Strategy which cooperates unless the partner defected in the last round.
Strategy which cooperates if both players chose the same action last round, otherwise WSLS defects.Also known as PTFT.
Strategy which cooperates until either player defects, then it defects twice and returns to cooperation (regardless of the actions during the punishment phase).
Dal Bo P, Frechette GR (2011). "The Evolution of Cooperation in Infinitely Repeated Games: Experimental Evidence." American Economic Review, 101(1), 411-429.
strategies <- strategies.DF2011[c("ALLD","ALLC","TFT","GRIM")]
strategies <- strategies.DF2011[c("ALLD","ALLC","TFT","GRIM")]
The conformist and anticonformist strategy identifies by Dvorak, Fischbacher, and Schmelz (2020).
data(strategies.DFS2020)
data(strategies.DFS2020)
Each strategy is encoded as a stratEst.strategy object. The rows of the data frame represent the states of the strategy. The first row is the start state of the strategy. Each stratEst.strategy object contains the following variables:
prob.follow
Probability to follow own preference.
prob.deviate
Probability to deviate from the own preference.
tr(not in line)
State transition for the input the choices of the others are not in line with the own preference.
tr(in line)
State transition for the input the choices of the others are in line with the own preference.
The strategies are:
Strategy that generally follows the own preference if the choices of the other group members are in line with the own preference and deviates from the own preference the choices of the other group members are not in line with the own preference.
Strategy that frequently deviates from the own preference the choices of the other group members are in line with the own preference and follows the own preference if the choices of the other group members are not in line with the own preference.
Dvorak F, Fischbacher U, Schmelz K (2020). "Incentives for Conformity and Anticonformity." TWI Working Paper Series.
strategies <- strategies.DFS2020[c("conformist","anticonformist")]
strategies <- strategies.DFS2020[c("conformist","anticonformist")]
List of eleven prisoner's dilemma strategies (Fudenberg, Rand, and Dreber 2012).
data(strategies.FRD2012)
data(strategies.FRD2012)
Each strategy is encoded as a data.frame object. The rows of the data frame represent the states of the automaton. The first row is the start state of the automaton. Each data.frame object contains the following variables:
prob.d
Probability to defect.
prob.c
Probability to cooperate.
tremble
Probability of a tremble.
tr(cc)
State transition for the input cc.
tr(cd)
State transition for the input cd.
tr(dc)
State transition for the input dc.
tr(dd)
State transition for the input dd.
c("ALLC","TFT","TF2T","TF3T","T2FT","T2F2T","GRIM","GRIM2","GRIM3","ALLD","DTFT")
The prisoner's dilemma strategies are:
Strategy which always cooperates.
Strategy which cooperates unless the partner defected in the last round.
Strategy which cooperates unless the partner defected in the last two rounds.
Strategy which cooperates unless the partner defected in the last three rounds.
Strategy which cooperates unless the partner defected in either of the last two rounds.
Strategy which cooperates unless the partner defected for two consecutive rounds of the last three rounds.
Strategy which cooperates until one player defects, then GRIM defects forever.
Strategy which cooperates until two consecutive rounds occur in which one player defected, then GRIM2 defects forever.
Strategy which cooperates until three consecutive rounds occur in which one player defected, then GRIM3 defects forever.
Strategy which always defects.
Strategy which starts with defection, then plays according to TFT.
Fudenberg D, Rand DG, Dreber A (2012). "Slow to Anger and Fast to Forgive: Cooperation in an Uncertain World." American Economic Review, 102(2), 720-749.
strategies <- strategies.FRD2012[c("ALLC","ALLD","TFT","GRIM","PTFT")]
strategies <- strategies.FRD2012[c("ALLC","ALLD","TFT","GRIM","PTFT")]
List of 24 prisoner's dilemma strategies (Dal Bo and Frechette 2011; Fudenberg, Rand, and Dreber 2012; Breitmoser 2015).
data(strategies.PD)
data(strategies.PD)
Each strategy is encoded as a data.frame object. The rows of the data frame represent the states of the automaton. The first row is the start state of the automaton. Each data.frame object contains the following variables:
prob.d
Probability to defect.
prob.c
Probability to cooperate.
tremble
Probability of a tremble.
tr(cc)
State transition for the input cc.
tr(cd)
State transition for the input cd.
tr(dc)
State transition for the input dc.
tr(dd)
State transition for the input dd.
The prisoner's dilemma strategies are:
Strategy which always cooperates.
Strategy which always defects.
Strategy which starts with defection and then alternates between cooperation and defection.
Strategy which starts with defection, then plays according to GRIM2.
Strategy which starts with defection, then plays according to GRIM3.
Strategy which starts with defection, then plays according to TF2T.
Strategy which starts with defection, then plays according to TF3T.
Strategy which starts with defection, then plays according to TFT.
Strategy which starts with cooperation, then defects forever.
Strategy which cooperates until one player defects, then GRIM defects forever.
Strategy which cooperates until two consecutive rounds occur in which one player defected, then GRIM2 defects forever.
Strategy which cooperates until three consecutive rounds occur in which one player defected, then GRIM3 defects forever.
Strategy which cooperates if both players cooperated, and defects if both players defected in the last round. If the own action was cooperation and the other player defected, cooperate with some probability. If the own action was defection and the other player cooperated, cooperate with some (potentially different) probability.
Strategy which cooperates if both players cooperated in the last two rounds, both players defected in the last two rounds, or both players defected two rounds ago and cooperated in the last round. Otherwise PT2FT defect.
Strategy which cooperates if both players chose the same action last round, otherwise PTFT defects.Also known as WSLS.
Strategy which uniformly randomizes between cooperation and defection.
Semi grim strategy (Breitmoser, 2015). The strategy cooperates if both players cooperated, and defects if both players defected in the last round. If one player defected and the other cooperated, cooperate with some probability.
Strategy which cooperates until either player defects, then it defects twice and returns to cooperation (regardless of the actions during the punishment phase).
Strategy which cooperates unless the partner defected for two consecutive rounds of the last three rounds.
Strategy which cooperates unless the partner defected in either of the last two rounds.
Strategy which cooperates unless the partner defected in the last two rounds.
Strategy which cooperates unless the partner defected in the last three rounds.
Strategy which cooperates unless the partner defected in the last round.
Strategy which cooperates if both players chose the same action last round, otherwise WSLS defects.Also known as PTFT.
Breitmoser Y (2015). "Cooperation, but no Reciprocity: Individual Strategies in the Repeated Prisoner’s Dilemma." American Economic Review, 105(9), 2882-2910.
Dal Bo P, Frechette GR (2011). "The Evolution of Cooperation in Infinitely Repeated Games: Experimental Evidence." American Economic Review, 101(1), 411-429.
Fudenberg D, Rand DG, Dreber A (2012). "Slow to Anger and Fast to Forgive: Cooperation in an Uncertain World." American Economic Review, 102(2), 720-749.
strategies <- strategies.PD[c("ALLC","ALLD","TFT","GRIM","PTFT")]
strategies <- strategies.PD[c("ALLC","ALLD","TFT","GRIM","PTFT")]
Six rock-paper-scissors strategies.
data(strategies.RPS)
data(strategies.RPS)
Each strategy is encoded as a stratEst.strategy object. The rows of the data frame represent the states of the strategy. The first row is the start state of the strategy. Each stratEst.strategy object contains the following variables:
prob.r
Probability to play rock.
prob.p
Probability to play paper.
prob.s
Probability to play scissors.
tremble
Probability of a tremble.
tr(r)
State transition for the input last choice was rock.
tr(p)
State transition for the input last choice was paper.
tr(s)
State transition for the input last choice was scissors.
The rock-paper-scissors strategies are:
Strategy which plays rock.
Strategy which plays paper.
Strategy which plays scissors.
Nash equilibrium strategy which plays every action with probability one-third.
Strategy which plays every action with a certain probability.
Strategy which plays a random action in the first round and subsequently imitates the last choice.
strategies <- strategies.RPS[c("nash","mixed","imitate")]
strategies <- strategies.RPS[c("nash","mixed","imitate")]
Performs variants of the strategy estimation method.
stratEst( data, strategies, shares, coefficients, covariates, sample.id, response = "mixed", sample.specific = c("shares", "probs", "trembles"), r.probs = "no", r.trembles = "global", select = NULL, min.strategies = 1, crit = "bic", se = "analytic", outer.runs = 1, outer.tol = 1e-10, outer.max = 1000, inner.runs = 10, inner.tol = 1e-05, inner.max = 10, lcr.runs = 100, lcr.tol = 1e-10, lcr.max = 1000, bs.samples = 1000, quantiles = c(0.01, 0.05, 0.5, 0.95, 0.99), stepsize = 1, penalty = FALSE, verbose = TRUE )
stratEst( data, strategies, shares, coefficients, covariates, sample.id, response = "mixed", sample.specific = c("shares", "probs", "trembles"), r.probs = "no", r.trembles = "global", select = NULL, min.strategies = 1, crit = "bic", se = "analytic", outer.runs = 1, outer.tol = 1e-10, outer.max = 1000, inner.runs = 10, inner.tol = 1e-05, inner.max = 10, lcr.runs = 100, lcr.tol = 1e-10, lcr.max = 1000, bs.samples = 1000, quantiles = c(0.01, 0.05, 0.5, 0.95, 0.99), stepsize = 1, penalty = FALSE, verbose = TRUE )
data |
A |
strategies |
A list of strategies. Each strategy is a data.frame of class |
shares |
A vector of strategy shares. The elements to the order of strategies in the list |
coefficients |
Column vector which contains the latent class regression coefficients. The elements correspond to the vector of estimates. |
covariates |
A character vector indicating the names of the variables in data that are the covariates of the latent class regression model. Rows with the same id must have the values of covariates. Missing value are not allowed. |
sample.id |
A character indicating the name of the variable which identifies the samples. Individual observations must be nested in samples. The same must be true for clusters if specified. If more than one sample exists, shares are estimated for each sample. All other parameters are estimated for the data of all samples. If the object is not supplied, it is assumed that the data contains only one sample. |
response |
A string which can be set to |
sample.specific |
A character vector defining which model parameters are sample specific. If the vector contains the character |
r.probs |
A string which can be set to |
r.trembles |
A string which can be set to |
select |
A character vector indicating which model parameters are selected. If the vector contains the character |
min.strategies |
An integer which specifies the minimum number of strategies in case of strategy selection. The strategy selection procedure stops if the minimum is reached. |
crit |
A string which can be set to |
se |
A string which can be set to |
outer.runs |
A positive integer which stets the number of outer runs of the solver. Default is 1. |
outer.tol |
A positive number which stets the tolerance of the continuation condition of the outer runs. The iterative algorithm stops if the relative decrease of the log-likelihood is smaller than |
outer.max |
A positive integer which stets the maximum number of iterations of the outer runs of the solver. The iterative algorithm stops if it did not converge after |
inner.runs |
A positive integer which stets the number of inner runs of the solver. Default is 10. |
inner.tol |
A positive number which stets the tolerance of the continuation condition of the inner EM runs. The iterative algorithm stops if the relative decrease of the log-likelihood is smaller than |
inner.max |
A positive integer which stets the maximum number of iterations of the inner EM runs. The iterative algorithm stops if it did not converge after |
lcr.runs |
A positive integer which stets the number of estimation runs for latent class regression. Default is 100. |
lcr.tol |
A positive number which stets the tolerance of the continuation condition of the Latent Class Regression runs. The iterative algorithm stops if the relative decrease of the log-likelihood is smaller than |
lcr.max |
A positive integer which stets the maximum number of iterations of the Latent Class Regression EM runs. The iterative algorithm stops if it did not converge after |
bs.samples |
A positive integer which sets the number of bootstrap samples drawn with replacement. |
quantiles |
A numeric vector indicating the quantiles of the sampling distribution of the estimated parameters. The quantiles are identified based on the standard error or based on bootstrapping the sampling distribution of the parameter. |
stepsize |
A positive number which sets the stepsize of the Fisher scoring algorithm used to estimate the coefficients of the latent class regression model. Default is one. Values smaller than one slow down the convergence of the algorithm. |
penalty |
A logical indicating if the Firth penalty is used to estimate the coefficients of the latent class regression model. Default is |
verbose |
A logical, if |
The estimation function stratEst()
returns maximum-likelihood estimates for the population shares and choice probabilities of a set of candidate strategies given some data from an economic experiment. Candidate strategies can be supplied by the user in the form of deterministic finite-state automata. The number and the complexity of strategies can be restricted by the user or selected based on information criteria. stratEst also features latent class regression to assess the influence of covariates on strategy choice.
An object of class stratEst
. A list with the following elements.
strategies |
A list of fitted strategies. |
shares |
Matrix of strategy shares. The order of rows corresponds to the order of strategies defined in the input object |
probs |
Matrix of choice probabilities. The value |
trembles |
Matrix of tremble probabilities of the strategies. The value |
coefficients |
Matrix of latent class regression coefficients for strategies. |
shares.par |
Estimated strategy shares. |
probs.par |
Estimated choice probabilities. |
trembles.par |
Estimated tremble probabilities. |
coefficients.par |
Estimated latent class regression coefficients. |
shares.indices |
Indices of strategy shares. |
probs.indices |
Indices of choice probabilities. |
trembles.indices |
Indices of tremble probabilities. |
coefficients.indices |
Indices of latent class regression coefficients. |
loglike |
The log-likelihood of the model. Larger values indicate a better fit of the model to the data. |
crit.val |
The value of the selection criterion defined under |
eval |
Number of iterations of the solver. The reported number is the sum of iterations performed in the inner and the outer run which produced the reported estimates. |
tol.val |
The relative decrease of the log-likelihood in the last iteration of the algorithm. |
convergence |
Maximum absolute score of the model parameters. Small values indicate convergence of the algorithm to a (local) maximum of the negative log likelihood. |
entropy |
Entropy of the posterior probability assignments of individuals to strategies. |
state.obs |
A column vector with the number of weighted observations for each strategy state corresponding to the rows of |
posterior.assignments |
Posterior probability of each individual to use a strategy. |
prior.assignments |
Prior probability of each individual to use a strategy as predicted by the individual covariates. |
shares.se |
Standard errors of the estimated shares. |
probs.se |
Standard errors of the estimated choice probabilities. |
trembles.se |
Standard errors of the estimated trembles. |
coefficients.se |
Standard errors of the estimated coefficients. |
shares.score |
Score of the estimated shares. |
probs.score |
Score of the reported choice probabilities. |
trembles.score |
Score of the reported trembles. |
coefficients.score |
Score of the reported coefficients. |
shares.fisher |
Fisher information of the estimated shares. |
probs.fisher |
Fisher information of the reported choice probabilities. |
trembles.fisher |
Fisher information of the reported trembles. |
coefficients.fisher |
Fisher information of the reported coefficients. |
num.obs |
Number of observations. |
num.ids |
Number of individuals. |
num.par |
Total number of model parameters. |
free.par |
Total number of free model parameters. |
res.degrees |
Residual degrees of freedom (num.ids - free.par). |
shares.quantiles |
Quantiles of the estimated shares. |
probs.quantiles |
Quantiles of the estimated choice probabilities. |
trembles.quantiles |
Quantiles of the estimated tremble probabilities. |
coefficients.quantiles |
Quantiles of the estimated latent class regression coefficients. |
gammas |
Gamma parameter of the model. |
gammas.par |
Estimated gamma parameters. |
gammas.se |
Standard errors of the gamma parameters. |
#
aic |
Akaike information criterion. |
bic |
Bayesian information criterion. |
icl |
Integrated classification likelihood information criteria. |
The strategy estimation method was introduced by (Dal Bo & Frechette 2011) to estimate the relative frequency of a fixed set of pure strategies in the indefinitely repeated prisoner's dilemma. Breitmoser (2015) extended the method to the estimation of behavior strategies. The stratEst package uses the EM algorithm (Dempster, Laird & Rubin 1977) and the Newton-Raphson method to obtain maximum-likelihood estimates for the population shares and choice probabilities of a set of candidate strategies. The package builds on other software contributions of the R community. To increase speed the estimation procedures, the package uses integration of C++ and R achieved by the Rcpp package (Eddelbuettel & Francois 2011) and the open source linear algebra library for the C++ language RppArmadillo (Sanderson & Curtin 2016).
Breitmoser, Y. (2015): Cooperation, but no reciprocity: Individual strategies in the repeated prisoner's dilemma, American Economic Review, 105, 2882-2910.
Dal Bo, P. and G. R. Frechette (2011): The evolution of cooperation in infinitely repeated games: Experimental evidence, American Economic Review, 101, 411-429.
Dempster, A., N. Laird, and D. B. Rubin (1977): Maximum likelihood from incomplete data via the EM algorithm," Journal of the Royal Statistical Society Series B, 39, 1-38.
Eddelbuettel, D. and R. Francois (2011): Rcpp: Seamless R and C++ Integration, Journal of Statistical Software, 40, 1-18.
Sanderson, C. and R. Curtin (2016): Armadillo: a template-based C++ library for linear algebra. Journal of Open Source Software, 1-26.
Check model assumptions
stratEst.check(model, chi.tests = FALSE, bs.samples = 100, verbose = FALSE)
stratEst.check(model, chi.tests = FALSE, bs.samples = 100, verbose = FALSE)
model |
a fitted model of class |
chi.tests |
a logical. If |
bs.samples |
an integer. The number of parametric bootstrap samples for the chi square tests. Default is 100. |
verbose |
a logical, if |
The function for model checking of the package.
A list of check results with the following elements:
fit |
a matrix. Contains the log likelihood, the number of free model parameters, and the value of the three information criteria. |
chi.global |
a matrix. The results of the chi square test for global model fit. |
chi.local |
a matrix. The results of the chi square test for local model fit. |
Wang Z, Xu B, Zhou HJ (2014). "Social Cycling and Conditional Responses in the Rock-Paper-Scissors Game." Scientific Reports, 4(1), 2045-2322.
## Fit and check a mixture model for the rock-paper-scissors data of Wang, Xu, and Zhou (2014). strategies.mixture = strategies.RPS[c("nash","imitate")] model.mixture <- stratEst.model(data.WXZ2014,strategies.mixture) model.mixture.check <- stratEst.check( model.mixture ) print(model.mixture.check$fit)
## Fit and check a mixture model for the rock-paper-scissors data of Wang, Xu, and Zhou (2014). strategies.mixture = strategies.RPS[c("nash","imitate")] model.mixture <- stratEst.model(data.WXZ2014,strategies.mixture) model.mixture.check <- stratEst.check( model.mixture ) print(model.mixture.check$fit)
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 )
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"))
## 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"))
The estimation function of the package.
stratEst.model( data, strategies, shares = NULL, coefficients = NULL, covariates = NULL, sample.id = NULL, response = "mixed", sample.specific = c("shares", "probs", "trembles"), r.probs = "no", r.trembles = "global", select = NULL, min.strategies = 1, crit = "bic", se = "analytic", outer.runs = 1, outer.tol = 1e-10, outer.max = 1000, inner.runs = 10, inner.tol = 1e-05, inner.max = 10, lcr.runs = 100, lcr.tol = 1e-10, lcr.max = 1000, bs.samples = 1000, quantiles = c(0.05, 0.5, 0.95), step.size = 1, penalty = FALSE, verbose = FALSE )
stratEst.model( data, strategies, shares = NULL, coefficients = NULL, covariates = NULL, sample.id = NULL, response = "mixed", sample.specific = c("shares", "probs", "trembles"), r.probs = "no", r.trembles = "global", select = NULL, min.strategies = 1, crit = "bic", se = "analytic", outer.runs = 1, outer.tol = 1e-10, outer.max = 1000, inner.runs = 10, inner.tol = 1e-05, inner.max = 10, lcr.runs = 100, lcr.tol = 1e-10, lcr.max = 1000, bs.samples = 1000, quantiles = c(0.05, 0.5, 0.95), step.size = 1, penalty = FALSE, verbose = FALSE )
data |
a |
strategies |
a list of strategies. Each element if the list must be an object of class |
shares |
a numeric vector of strategy shares. The order of the elements corresponds to the order in |
coefficients |
a matrix of latent class regression coefficients. |
covariates |
a character vector with the names of the covariates of the latent class regression model in the data. The covariates cannot have missing values. |
sample.id |
a character string indicating the name of the variable which identifies the samples in data. Individual observations must be nested in samples. |
response |
a character string which is either |
sample.specific |
a character vector, Defines the model parameters that are sample specific. Can contain the character strings |
r.probs |
a character string. Options are |
r.trembles |
a character string. Options are |
select |
a character vector. Indicates the classes of model parameters that are selected. Can contain the character strings |
min.strategies |
an integer. The minimum number of strategies in case of strategy selection. The strategy selection procedure stops if the minimum is reached. |
crit |
a character string. Defines the information criterion used for model selection. Options are |
se |
a string. Defines how standard errors are obtained. Options are |
outer.runs |
an integer. The number of outer runs of the solver. Default is 1. |
outer.tol |
a number close to zero. The tolerance of the stopping condition of the outer runs. The iterative algorithm stops if the relative decrease of the log likelihood is smaller than this number. Default is 1e-10. |
outer.max |
an integer. The maximum number of iterations of the outer runs of the solver. The iterative algorithm stops after |
inner.runs |
an integer. The number of inner runs of the solver. Default is 10. |
inner.tol |
a number close to zero. The tolerance of the stopping condition of the inner runs. The iterative algorithm stops if the relative decrease of the log likelihood is smaller than this number. Default is 1e-5. |
inner.max |
an integer. The maximum number of iterations of the outer runs of the solver. The iterative algorithm stops after |
lcr.runs |
an integer. The number of latent class regression runs of the solver. Default is 100. |
lcr.tol |
a number close to zero. The tolerance of the stopping condition of the latent class regression runs. The iterative algorithm stops if the relative decrease of the log likelihood is smaller than this number. Default is 1e-10. |
lcr.max |
an integer. The maximum number of iterations of the latent class regression runs of the solver. The iterative algorithm stops after |
bs.samples |
an integer. The number of bootstrap samples. |
quantiles |
a numeric vector. The quantiles of the sampling distribution of the estimated parameters. Depending on the option of |
step.size |
a number between zero and one. The step size of the Fisher scoring step which updates the coefficients. Values smaller than one slow down the convergence of the algorithm and prevent overshooting. Default is one. |
penalty |
a logical. If |
verbose |
a logical. If |
The estimation function of the package obtains maximum likelihood estimates for the model parameters based on expectation maximization and Newton-Raphson algorithms.
An object of class stratEst.model
. A list with the following elements.
strategies |
the fitted strategies. |
shares |
the strategy shares. |
probs |
the choice probabilities of the strategies. |
trembles |
the tremble probabilities of the strategies. |
gammas |
the gamma parameters of the strategies. |
coefficients |
the coefficients of the covariates. |
shares.par |
the estimated strategy share parameters. |
probs.par |
the estimated choice probability parameters. |
trembles.par |
the estimated tremble parameters. |
gammas.par |
the estimated gamma parameters. |
coefficients.par |
the estimated coefficient parameters of the covariates. |
shares.indices |
the parameter indices of the strategy shares. |
probs.indices |
the parameter indices of the choice probabilities. |
trembles.indices |
the parameter indices of the tremble probabilities. |
coefficients.indices |
the parameter indices of the coefficients. |
loglike |
the log likelihood of the model. |
num.ids |
the number of individuals. |
num.obs |
the number of observations. |
num.par |
the total number of model parameters. |
free.par |
the number of free model parameters. |
res.degrees |
the residual degrees of freedom. |
aic |
the Akaike information criterion. |
bic |
the Bayesian information criterion. |
icl |
The integrated classification likelihood. |
crit.val |
the value of the selection criterion defined by the argument |
eval |
the total number of iterations of the solver. |
tol.val |
the relative decrease of the log likelihood in the last iteration of the algorithm. |
convergence |
the maximum of the absolute scores of the estimated model parameters. |
entropy.model |
the entropy of the model. |
entropy.assignments |
the entropy of the posterior probability assignments of individuals to strategies. |
chi.global |
the chi square statistic for global model fit. |
chi.local |
the chi square statistics for local model fit. |
state.obs |
the weighted observations for each strategy state. |
post.assignments |
the posterior probability assignments of individuals to strategies. |
prior.assignments |
the prior probability of each individual to use a strategy as predicted by the individual covariates. |
shares.se |
the standard errors of the estimated share parameters. |
probs.se |
the standard errors of the estimated choice probability parameters. |
trembles.se |
the standard errors of the estimated tremble probability parameters. |
gammas.se |
the standard errors of the estimated gamma parameters. |
coefficients.se |
the standard errors of the estimated coefficients. |
shares.quantiles |
the quantiles of the estimated population shares. |
probs.quantiles |
the quantiles of the estimated choice probabilities. |
trembles.quantiles |
the quantiles of the estimated trembles. |
coefficients.quantiles |
the quantiles of the estimated coefficients. |
shares.score |
the scores of the estimated share parameters. |
probs.score |
the score of the estimated choice probabilities. |
trembles.score |
the score of the estimated tremble probabilities. |
coefficients.score |
the score of the estimated coefficient. |
shares.fisher |
the Fisher information matrix of the estimated shares. |
probs.fisher |
the Fisher information matrix of the estimated choice probabilities. |
trembles.fisher |
the Fisher information matrix of the estimated trembles. |
coefficients.fisher |
the fisher information matrix of the estimated coefficients. |
fit.args |
the input objects of the function call. |
Strategy estimation was introduced by Dal Bo and Frechette (2011) to estimate the maximum likelihood frequencies of a set of candidate strategies in the repeated prisoner's dilemma. Breitmoser (2015) introduces model parameters for the choice probabilities of individual strategies to the strategy estimation model. Dvorak and Fehrler (2018) extend the basic strategy estimation model by individual level covariates to explain the selection of strategies by individuals. The estimation function of the package obtains maximum likelihood estimates for the model parameters based on expectation maximization (Dempster, Laird, and Rubin, 1977) and Newton-Raphson algorithms. To decrease the computation time, the package integrates C++ and R with the help of the R packages Rcpp (Eddelbuettel and Francois, 2011) and the open source linear algebra library for the C++ language RppArmadillo (Sanderson and Curtin, 2016).
Breitmoser Y (2015). "Cooperation, but no Reciprocity: Individual Strategies in the Repeated Prisoner’s Dilemma." American Economic Review, 105(9), 2882-2910.
Dal Bo P, Frechette GR (2011). "The Evolution of Cooperation in Infinitely Repeated Games: Experimental Evidence." American Economic Review, 101(1), 411-429.
Dempster A, Laird N, Rubin DB (1977). "Maximum Likelihood from Incomplete Data via the EM Algorithm." Journal of the Royal Statistical Society Series B, 39(1), 1-38.
Dvorak F, Fehrler S (2018). "Negotiating Cooperation under Uncertainty: Communication in Noisy, Indefinitely Repeated Interactions." IZA Working Paper, No. 11897.
Dvorak F, Fischbacher U, Schmelz K (2020). "Incentives for Conformity and Anticonformity." TWI Working Paper Series.
Eddelbuettel D, Francois R (2011). "Rcpp: Seamless R and C++ Integration." Journal of Statistical Software, 40(8), 1-18.
Fudenberg D, Rand DG, Dreber A (2012). "Slow to Anger and Fast to Forgive: Cooperation in an Uncertain World." American Economic Review, 102(2), 720-749.
Sanderson C, Curtin R (2016). "Armadillo: A Template-Based C++ Library for Linear Algebra." Journal of Open Source Software, 1, 26.
Wang Z, Xu B, Zhou HJ (2014). "Social Cycling and Conditional Responses in the Rock-Paper-Scissors Game." Scientific Reports, 4(1), 2045-2322.
## Strategy model for rock-paper-scissors data of Wang, Xu, and Zhou (2014). ## Fit a mixture of the Nash strategy and a strategy that imitates the last choice. strategies.mixture = list("nash" = strategies.RPS$nash, "imitate" = strategies.RPS$imitate) model.mixture <- stratEst.model(data.WXZ2014,strategies.mixture)
## Strategy model for rock-paper-scissors data of Wang, Xu, and Zhou (2014). ## Fit a mixture of the Nash strategy and a strategy that imitates the last choice. strategies.mixture = list("nash" = strategies.RPS$nash, "imitate" = strategies.RPS$imitate) model.mixture <- stratEst.model(data.WXZ2014,strategies.mixture)
The simulation function of the package.
stratEst.simulate( data = NULL, strategies, shares = NULL, coefficients = NULL, covariate.mat = NULL, num.ids = 100, num.games = 5, num.periods = NULL, fixed.assignment = TRUE, input.na = FALSE, sample.id = NULL )
stratEst.simulate( data = NULL, strategies, shares = NULL, coefficients = NULL, covariate.mat = NULL, num.ids = 100, num.games = 5, num.periods = NULL, fixed.assignment = TRUE, input.na = FALSE, sample.id = NULL )
data |
a |
strategies |
a list of strategies. Each element if the list must be an object of class |
shares |
a numeric vector of strategy shares. The order of the elements corresponds to the order in |
coefficients |
a matrix of regression coefficients. Column names correspond to the names of the strategies, row names to the names of the covariates. |
covariate.mat |
a matrix with the covariates in columns. The column names of the matrix indicate the names of the covariates. The matrix must have as many rows as there are individuals. |
num.ids |
an integer. The number of individuals. Default is 100. |
num.games |
an integer. The number of games. Default is 5. |
num.periods |
a vector of integers with as many elements |
fixed.assignment |
a logical value. If |
input.na |
a logical value. If |
sample.id |
a character string indicating the name of the variable which identifies the samples in data. Individual observations must be nested in samples. Default is |
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. |
sample |
the sample of the individual. |
strategy |
the strategy of the individual. |
## Simulate data of two strategies for choices "left" and "right". lr <- c("left","right") pi <- runif(1) pr <- c(1,0,0,1) tr <- c(1,2,1,2) mixed <- stratEst.strategy(choices = lr, inputs = lr, prob.choices = c(pi, 1 - pi)) pure <- stratEst.strategy(choices = lr, inputs = lr, prob.choices = pr, tr.inputs = tr) gamma <- runif(1)/4 pure$tremble <- gamma beta <- rnorm(1) p <- 1/sum(1 + exp(beta)) sim.shares <- c(p, 1-p) sim.strategies <- list("mixed" = mixed, "pure" = pure) sim.data <- stratEst.simulate(strategies = sim.strategies, shares = sim.shares)
## Simulate data of two strategies for choices "left" and "right". lr <- c("left","right") pi <- runif(1) pr <- c(1,0,0,1) tr <- c(1,2,1,2) mixed <- stratEst.strategy(choices = lr, inputs = lr, prob.choices = c(pi, 1 - pi)) pure <- stratEst.strategy(choices = lr, inputs = lr, prob.choices = pr, tr.inputs = tr) gamma <- runif(1)/4 pure$tremble <- gamma beta <- rnorm(1) p <- 1/sum(1 + exp(beta)) sim.shares <- c(p, 1-p) sim.strategies <- list("mixed" = mixed, "pure" = pure) sim.data <- stratEst.simulate(strategies = sim.strategies, shares = sim.shares)
Creates a stratEst.strategy object.
stratEst.strategy( choices, inputs = NULL, prob.choices = NULL, tr.inputs = NULL, trembles = NULL, num.states = NULL )
stratEst.strategy( choices, inputs = NULL, prob.choices = NULL, tr.inputs = NULL, trembles = NULL, num.states = NULL )
choices |
a character vector. The levels of the factor |
inputs |
a character vector. The levels of the factor |
prob.choices |
a numeric vector. The choice probabilities of the strategy in columnwise order. |
tr.inputs |
a vector of integers. The deterministic state transitions of the strategy in columnwise order. |
trembles |
a numeric vector. The tremble probabilities of the strategy. |
num.states |
an integer. The number states of the strategy. |
The strategy generation function of the package.
A stratEst.strategy
object. A data.frame with the following variables:
prob.x |
the probability of choice |
tremble |
the probability to observe a tremble. |
tr(x) |
the deterministic state transitions of the strategy for input |
## Nash equilibrium strategy of rock-paper-scissors ins = c(NA,"rock","paper","scissors") rps = c("rock","paper","scissors") mixed = stratEst.strategy(choices = rps) nash = stratEst.strategy(choices = rps, prob.choices = rep(1/3,3)) rock = stratEst.strategy(choices = rps, prob.choices = c(1,0,0))
## Nash equilibrium strategy of rock-paper-scissors ins = c(NA,"rock","paper","scissors") rps = c("rock","paper","scissors") mixed = stratEst.strategy(choices = rps) nash = stratEst.strategy(choices = rps, prob.choices = rep(1/3,3)) rock = stratEst.strategy(choices = rps, prob.choices = c(1,0,0))
Runs t-tests if model parameters differ from user defined values
stratEst.test( model, par = c("shares", "probs", "trembles", "coefficients"), values = NA, alternative = "two.sided", coverage = 0.95, digits = 4, plot.tests = TRUE )
stratEst.test( model, par = c("shares", "probs", "trembles", "coefficients"), values = NA, alternative = "two.sided", coverage = 0.95, digits = 4, plot.tests = TRUE )
model |
a fitted model of class |
par |
a character vector. The class of model parameters to be tested. Default is |
values |
a numeric vector. The values the parameter estimates are compared to. Default is NA which means zero. |
alternative |
a character string. The alternative hypothesis. Options are |
coverage |
a probability. The coverage of the plotted confidence intervals. Default is 0.95. |
digits |
an integer. The number of digits of the result. |
plot.tests |
a logical. Plots tests if |
The test function of the package.
A data.frame
with one row for each tested parameter and 6 variables:
estimate |
the parameter estimate. |
diff |
the difference between the estimated parameter and the numeric value. |
std.error |
the standard error of the estimated parameter. |
t.value |
the TRUE statistic. |
res.degrees |
the residual degrees of freedom of the model. |
p.value |
the p value of the TRUE statistic. |
Wang Z, Xu B, Zhou HJ (2014). "Social Cycling and Conditional Responses in the Rock-Paper-Scissors Game." Scientific Reports, 4(1), 2045-2322.
## Test if the choice probabilities of a mixed strategy for rock-paper-scissors. ## The rock-paper-scissors data is from Wang, Xu, and Zhou (2014). model.mixed <- stratEst.model(data = data.WXZ2014, strategies = strategies.RPS["mixed"]) t.probs <- stratEst.test(model = model.mixed, par = "probs", values = 1/3) print(t.probs)
## Test if the choice probabilities of a mixed strategy for rock-paper-scissors. ## The rock-paper-scissors data is from Wang, Xu, and Zhou (2014). model.mixed <- stratEst.model(data = data.WXZ2014, strategies = strategies.RPS["mixed"]) t.probs <- stratEst.test(model = model.mixed, par = "probs", values = 1/3) print(t.probs)
Method dispatch for Generic Function Summary
## S3 method for class 'stratEst.check' summary(object, ...)
## S3 method for class 'stratEst.check' summary(object, ...)
object |
An object returned by the function |
... |
additional arguments affecting the summary produced. |
No return value, prints a summary of the model checks to the console.
Method dispatch for Generic Function summary
## S3 method for class 'stratEst.data' summary(object, ...)
## S3 method for class 'stratEst.data' summary(object, ...)
object |
An object to be summarized. |
... |
additional arguments affecting the result. |
No return value, prints a summary of the datas to the console.
Method dispatch for Generic Function Summary
## S3 method for class 'stratEst.model' summary(object, ..., plot.shares = TRUE)
## S3 method for class 'stratEst.model' summary(object, ..., plot.shares = TRUE)
object |
An object returned by the estimation function |
... |
additional arguments affecting the summary produced. |
plot.shares |
Logical. If TRUE a barchart of the shares is plotted. |
No return value, prints a summary of the model to the console.
Experimental data of 72 participants playing 300 periods of the rock-paper-scissors game in matching groups of six.
data(WXZ2014)
data(WXZ2014)
A data.frame with 21.600 rows and 6 variables:
Variable which identifies the participant.
The identifier of the game.
The period within the game.
A factor with three levels which indicates if the player chooses rock, paper or scissors.
A factor with three levels which indicates if the other player chooses rock, paper or scissors.
A factor with three levels which indicates if the result for the player.
Wang Z, Xu B, Zhou HJ (2014). "Social Cycling and Conditional Responses in the Rock-Paper-Scissors Game." Scientific Reports, 4(1), 2045-2322.