link{sim}
(for a factor simplex), and link{sim}
( for a data simplex) sim.circ
for a circumplex structure, sim.congeneric
(for a one factor factor congeneric model), sim.dichot
(to simulate dichotomous items), sim.hierarchical
(a hierarchical factor model), sim.item
(general item simulations), sim.structural
(general simulation of structural models), sim.anova
for ANOVA and lm simulatins, and sim.VSS
. These functions are separately documented and are listed here for ease of the help function. See each function for more detailed help.sim(fx=NULL,Phi=NULL,fy=NULL,n=0,mu=NULL,raw=FALSE)
sim.simplex(nvar =12, r=.8,mu=NULL, n=0)
The default values for sim.structure
is to generate a 4 factor, 12 variable data set with a simplex structure between the factors.
Other simulation functions in psych are:
sim.structure
A function to combine a measurement and structural model into one data matrix. Useful for understanding structural equation models.
sim.congeneric
A function to create congeneric items/tests for demonstrating classical test theory. This is just a special case of sim.structure.
sim.hierarchical
A function to create data with a hierarchical (bifactor) structure.
sim.item
A function to create items that either have a simple structure or a circumplex structure.
sim.circ
Create data with a circumplex structure.
sim.dichot
Create dichotomous item data with a simple or circumplex structure.
sim.anova
Simulate a 3 way balanced ANOVA or linear model, with or without repeated measures.
simplex <- sim()
round(simplex$model,2)
congeneric <- sim.congeneric()
round(congeneric,2)
R <- sim.hierarchical()
R
fx <- matrix(c(.9,.8,.7,rep(0,6),c(.8,.7,.6)),ncol=2)
fy <- c(.6,.5,.4)
Phi <- matrix(c(1,0,.5,0,1,.4,0,0,0),ncol=3)
print(sim.structure(fx,Phi,fy,),digits=2)
cor.plot(R) #show it graphically
simp <- sim.simplex()
#show the simplex structure using cor.plot
cor.plot(simp)
Run the code above in your browser using DataLab