dat <- simDataSet(
500,
varNames=c('age',
'sex',
'educationLevel',
'negativeLifeEventsInPast10Years',
'problemCoping',
'emotionCoping',
'resilience',
'depression'),
means = c(40,
0,
0,
5,
3.5,
3.5,
3.5,
3.5),
sds = c(10,
1,
1,
1.5,
1.5,
1.5,
1.5,
1.5),
specifiedCorrelations =
list(c('problemCoping', 'emotionCoping', -.5),
c('problemCoping', 'resilience', .5),
c('problemCoping', 'depression', -.4),
c('depression', 'emotionCoping', .6),
c('depression', 'resilience', -.3)),
ranges = list(age = c(18, 54),
negativeLifeEventsInPast10Years = c(0,8),
problemCoping = c(1, 7),
emotionCoping = c(1, 7)),
factors=c("sex", "educationLevel"),
cuts=list(c(0),
c(-.5, .5)),
labels=list(c('female', 'male'),
c('lower', 'middle', 'higher')),
silent=FALSE);
Run the code above in your browser using DataLab