Learn R Programming

prodest (version 1.0.1)

panelSim: Simulate Panel dataset

Description

panelSim() produces a N*T balanced panel dataset of firms' production. In particular, it returns a data.frame with free, state and proxy variables aimed at performing Monte Carlo simulations on productivity-related models.

Usage

panelSim(N = 1000, T = 100, alphaL = .6, alphaK = .4, DGP = 1,
           rho = .7, sigeps = .1, sigomg = .3, rholnw = .3)

Arguments

N

the number of firms. By default N=1000

T

the total time span to be simulated. Only a fraction (the last 10% of observations) will be returned. By default T=100

alphaL

the parameter of the free variable. By default alphaL=.6

alphaK

the parameter of the state variable. By default alphaK=.4

DGP

Type of DGP; accepts 1, 2 or 3. They differ in terms of shock to wages (0 or 0.1), \(\Delta\) (0 or 0.5) and shock to labor (0 or 0.37). See \(details\). By default DGP=1.

rho

the AR(1) coefficient for omega. By default rho=0.7

sigeps

the standard deviation of epsilon. See \(details\). By default sigeps = .1.

sigomg

the standard deviation of the innovation to productivity \(\omega\). By default sigomg = .3.

rholnw

AR(1) coefficient for log(wage). By default rholnw=.3.

Value

\(panelSim()\) returns a data.frame with 7 variables:

  • \(idvar\) ID codes from 1 to N (by default \(N = 1000\)).

  • \(timevar\) time variable ranging 1 to \(round(T*0.1)\) (by default \(T = 100\) and \(max(timevar) = 10\)).

  • \(Y\) log output value added variable

  • \(sX\) log state variable

  • \(fX\) log free variable

  • \(pX1\) log proxy variable - no measurement error

  • \(pX2\) log proxy variable - \(\sigma_{measurementerror}= .1\)

  • \(pX3\) log proxy variable - \(\sigma_{measurementerror}= .2\)

  • \(pX4\) log proxy variable - \(\sigma_{measurementerror}= .5\)

Details

panelSim() is the R implementation of the DGP written by Ackerberg, Caves and Frazer (2015).

References

Ackerberg, D., Caves, K. and Frazer, G. (2015). "Identification properties of recent production function estimators." Econometrica, 83(6), 2411-2451.

Examples

Run this code
# NOT RUN {
  require(prodest)

  ## Simulate a dataset with 100 firms (T = 50).
  ## \code{Panelsim()} delivers the last 10% of usable time per panel.

  panel.data <- panelSim(N = 100, T = 50)
  attach(panel.data)

  ## Estimate various models
  ACF.fit <- prodestACF(Y, fX, sX, pX2, idvar, timevar, theta0 = c(.5,.5))
  
# }
# NOT RUN {
    LP.fit <- prodestLP(Y, fX, sX, pX2, idvar, timevar)
    WRDG.fit <- prodestWRDG(Y, fX, sX, pX3, idvar, timevar)

    ## print results in lateX tabular format
    printProd(list(LP.fit, ACF.fit, WRDG.fit))
  
# }

Run the code above in your browser using DataLab