Description Usage Arguments Details Value Author(s) Examples
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".
1 | spd4testing(N = 4, G = 2, Y = 5, missingY = FALSE, missingX = FALSE)
|
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 |
N*Y observations.
G is the number of groups.
Each group has the same size: N/G.
N/G must be a whole number.
data.frame
Elías Cisneros <ec@elias-cisneros.de>
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.