Learn R Programming

TAM (version 1.6-0)

sim.rasch: Simulated Rasch data

Description

Simulated Rasch data under unidimensional trait distribution

Usage

data(sim.rasch) 
 data(sim.rasch.pweights)
 data(sim.rasch.missing)

Arguments

format

The format is: num [1:2000, 1:40] 1 0 1 1 1 1 1 1 1 1 ... - attr(*, "dimnames")=List of 2 ..$ : NULL ..$ : chr [1:40] "I1" "I2" "I3" "I4" ...

Details

N <- 2000 # simulate predictors} \cr Y <- cbind( rnorm( N , sd = 1.5) , rnorm(N , sd = .3 ) ) theta <- rnorm( N ) + .4 * Y[,1] + .2 * Y[,2] # latent regression model} \cr # simulate item responses with missing data} \cr I <- 40 resp[ theta < 0 , c(1,seq(I/2+1 , I)) ] <- NA # define person weights} \cr pweights <- c( rep(3,N/2) , rep( 1, N/2 ) ) Simulated data (see Details) data(sim.rasch) N <- 2000 Y <- cbind( rnorm( N , sd = 1.5) , rnorm(N , sd = .3 ) ) # Loading Matrix # B <- array( 0 , dim = c( I , 2 , 1 ) ) # B[1:(nrow(B)), 2, 1] <- 1 B <- designMatrices(resp = sim.rasch)[["B"]] # estimate model mod1_1 <- tam(resp=sim.rasch , Y=Y) # standard errors res1 <- tam.se(mod1_1) # Compute fit statistics tam.fit(mod1_1) # plausible value imputation # PV imputation has to be adpated for multidimensional case! pv1 <- tam.pv( mod1_1 , nplausible = 7 , # 7 plausible values samp.regr = TRUE # sampling of regression coefficients ) # item parameter constraints xsi.fixed <- matrix( c( 1, -2,5, -.22,10, 2 ), nrow=3 , ncol=2 , byrow=TRUE) xsi.fixed mod1_4 <- tam( resp=sim.rasch , xsi.fixed=xsi.fixed ) # missing value handling data(sim.rasch.missing) mod1_2 <- tam(sim.rasch.missing , Y = Y) # handling of sample (person) weights data(sim.rasch.pweights) N <- 1000 pweights <- c( rep(3,N/2) , rep( 1, N/2 ) ) mod1_3 <- tam( sim.rasch.pweights , control = list(conv = .001) , pweights = pweights ) datasets