spd4testing: Small Panel Data Set for Testing

Description Usage Arguments Details Value Author(s) Examples

Description

spd4testing creates a panel data set with individual observations over time that belong to different groups. Individuals are coded with the variable "id". The time variable is given by "year". The group identifier is "gid". The data consits of one dependent variable "y", and two explanatory variables "x" and "u". In addtion spd4testing adds a constant factor "z" equal to one and weights "w" with values 1 or 0.5. To simulate a more complex data sttructure it is possible to randomly create missing values in "y" and/ or "x".

Usage

1
spd4testing(N = 4, G = 2, Y = 5, missingY = FALSE, missingX = FALSE)

Arguments

N

Number of individuals, id

G

Number of groups, gid

Y

Number of years, year

missingY

create missing outcome values for one observation in dataset

missingX

create missing explanatory values for one observation in dataset

Details

N*Y observations.
G is the number of groups.
Each group has the same size: N/G.
N/G must be a whole number.

Value

data.frame

Author(s)

Elías Cisneros <ec@elias-cisneros.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
spd4testing()

spd4testing(missingY=TRUE,missingX=TRUE)

spd4testing(N=6,G=3,Y=4)

## Not run: 
  spd4testing(N=6,G=4,Y=4) 
## End(Not run)

library(plm)
d <- spd4testing(missingY=FALSE,missingX=TRUE)
e<-plm(y ~ x + factor(year)*factor(gid), data=d, model="fd")
summary(e)


citation("spd4testing")

eliascis/spd4testing documentation built on May 31, 2019, 11:50 p.m.