Skip to content

simulation data with dichotomous varuables

2 messages · thanoon younis, William Revelle

5 days later
#
Dear Thanoon,
 You might look at the various item simulation functions in the psych package.

In particular, for your problem:

R1 <- sim.irt(10,1000,a=3,low = -2, high=2)
R2 <-  sim.irt(10,1000,a=3,low = -2, high=2)
R12 <- data.frame(R1$items,R2$items)
#this gives you 20 items, grouped with high correlations within the first 10, and the second 10, no correlation between the first and second sets.
rho <- tetrachoric(R12)$rho  #find the tetrachoric correlation between the items
lowerMat(rho)  #show the correlations
cor.plot(rho,numbers=TRUE)   #show a heat map of the correlations

Bill
On Aug 4, 2014, at 8:08 PM, thanoon younis <thanoon.younis80 at gmail.com> wrote:

            
William Revelle		           http://personality-project.org/revelle.html
Professor			           http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University	   http://www.northwestern.edu/
Use R for psychology             http://personality-project.org/r
It is 5 minutes to midnight	   http://www.thebulletin.org