gdat_cd: Generate Data

Description Usage Arguments Value See Also Examples

View source: R/Functions_Cross_Dep.R

Description

Generate panel data with cross-sectional dependence for classes of models viz. Generate data for model with a single weight delta

Usage

1
2
gdat_cd(pars, N, Tp, ncXm = 0, seed, fun, sder = NULL, eta = NULL,
  modclass = "lmcd")

Arguments

pars

vector of parameters to generate the data.

N

number of units in the panel

Tp

number of time periods

ncXm

number of other control variables to include

seed

seed for random number generation

fun

function that models cross-sectional dependence function φ(.,.)

sder

standard deviation for the error term. this option is applicable to the class "lmcd"

eta

additional parameter, like θ in the negative binomial class "nbcd" and seed for simulating the outcome for MLE methods. see c_out_dep

modclass

the class of model; see ncd_gen for models supported

Value

A data frame of Y,X,psID,tpID, where psID and tpID are unit and time IDs, Xm of ncXm columns if ncXm is specified

See Also

c_out_dep

Examples

1
2
3
4
5
pars = c(1.0,0.5,0.8); pars2=pars = c(1.0,0.5,0.8,0.1,-0.1); N = 10; Tp = 16 
fnp<- function(x,y) {-(0.5*y^4 + (x-y)^4)^.25} #poisson model
datpois = gdat_cd(pars=pars,N=N,Tp=Tp,seed=2,fun=fnp,eta = 200,modclass="poiscd") 
datpois2 = gdat_cd(pars=pars2,N=N,Tp=Tp,ncXm=2,seed=2,fun=fnp,eta = 200,modclass="poiscd")
summary(datpois); summary(datpois2);#NA's in first period for Y due to lag

estsyawo/RpacSPD documentation built on Aug. 12, 2019, 5:22 a.m.