sim_score_data: Simulation of multivariate score data

Description Usage Arguments Details Value Examples

View source: R/sim_score_data.R

Description

This function will simulate Person (raw)-scores for an arbitrary number of dimensions (latent variables), assessed with any type of questionnaire given the maximum and minimum raw score for each dimension.

Usage

1
2
3
4
5
6
7
8
sim_score_data(
  n = 1000,
  cormat,
  min.score = 0,
  max.score = 40,
  data.frame = FALSE,
  ...
)

Arguments

n

integer giving the number of cases (observations) in the data to simulate.

cormat

a correlation matrix describing the associations between the dimensions – for Hollnd's theory, typical a 6 x 6 matrix with named columns and rows with c("R","I","A","S","E","C").

min.score

numeric (possibly vector with max length == ncol(cormat) – will be recycled) with numeric value(s) defining the minimum raw scores per dimension

max.score

numeric (possibly vector with max length == ncol(cormat) – will be recycled) with numeric value(s) defining the maximum raw scores per dimension.

data.frame

logical whether to return a data.frame or a matrix

...

additional parameters passed through to rmvnorm.

Details

For Hollnd's theory, six dimensions (c("R","I","A","S","E","C")) are assumed being assessed with an questionnaire with 10 questions per dimension with each question having five response categories which are scored from '0' to '4' – thus min. raw score is 0 and max. rax score is 40 for each of the six dimension respectively.

Value

a data.frame with simulated raw scores.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# get an RIASEC correlation matrix
data(AIST_2005_F_1270)
# simulate raw scores with minimum = 0 and maximum = 40
a<-sim_score_data(n=1000,cormat=AIST_2005_F_1270)
apply(a, 2, range)
apply(a, 2, mean)
apply(a, 2, sd)
# simulate raw scores with minimum = 10 and maximum = 50
b<-sim_score_data(n=1000,cormat=AIST_2005_F_1270,min.score=10,max.score=50)
apply(b, 2, range)
apply(b, 2, mean)
apply(b, 2, sd)
# simulate norm scores (range between 70 and 130)
c<-sim_score_data(n=1000,cormat=AIST_2005_M_1226,min.score=70,max.score=130)
apply(c, 2, range)
apply(c, 2, mean)
apply(c, 2, sd)

holland documentation built on Sept. 5, 2021, 5:08 p.m.