Last data update: 2014.03.03

R: Simulate data (nrm)
NRM.simR Documentation

Simulate data (nrm)

Description

This function simulates data according to the Nominal Response Model.

Usage

NRM.sim(Parlist, pp)

Arguments

Parlist

A list of numerical vectors with item parameters has to be committed. Note that the zeta parameters as well as the lambda parameters have to add up to 0 for each item. For details concerning the structure of the list see section 'Details'.

pp

A numerical vector of person parameters.

Details

The structure of the Parlist is as follows:

  • Vector for Item 1: c(zeta1, zeta2, ..., lambda1, lambda2, ...)

  • Vector for Item 2: c(zeta1, zeta2, ..., lambda1, lambda2, ...)

  • etc.

Value

The function returns a length(pp)*length(Parlist) data.frame.

Author(s)

Manuel Reif

References

Bock, R. D. (1972). Estimating item parameters and latent ability when responses are scored in two or more nominal categories. Psychometrika, 37, 29-51.

See Also

NLM.sim

nrm

Examples




# Simulating 5 Items within a loop
ParList <- lapply(1:5,function(x)
{
  Item1 <- c(c(-2,-1,1,2),c(-1.2,0.3,0.2,0.7))
  names(Item1) <- c(paste("zeta",1:4,sep=""),paste("lamb",1:4,sep=""))
  Item1
})

names(ParList) <- paste("item",1:5,sep="")

# simulate person parameters
perp1     <- rnorm(1500,0,1)

# simulate data.frame 
sim.nrm.1 <- NRM.sim(ParList,perp1)




Results