# NOT RUN {
# 5 items with slopes equals 1 on all the latent traits
sM <- make_scoring_matrix_aem(5, sequence = "mae")
generate_slopes(5, sM, 1)
# 10 items with slopes on all the latent traits generated from a uniform
# distribution with limits 0.5 and 3
sM <- make_scoring_matrix_aem(5, sequence = "mae")
generate_slopes(10, sM, FUN = runif, min = 0.5, max = 3)
# 10 items with slopes generated from a normal distributions with parameters set to:
# trait 'm' (i.e. the first column in the scoring matrix): mean 1, sd 0.2
# trait 'a' (i.e. the second column in the scoring matrix): mean 1.2, sd 0.3
# trait 'e' (i.e. the third column in the scoring matrix): mean 1.5, sd 0.5
sM <- make_scoring_matrix_aem(5, sequence = "mae")
generate_slopes(10, sM, FUN = rnorm,
mean = c(1, 1.2, 1.5),
sd = c(0.2, 0.3, 0.5))
# 10 items with slopes generated from a truncated-normal distributions with
# parameters set to:
# trait 'm' (i.e. the first column in the scoring matrix): mean 1, sd 0.5
# trait 'a' (i.e. the second column in the scoring matrix): mean 1.2, sd 0.7
# trait 'e' (i.e. the third column in the scoring matrix): mean 1.5, sd 1
# and bounds equals to 0.5 (lower) and 2.5 (upper) for all the traits
sM <- make_scoring_matrix_aem(5, sequence = "mae")
require(truncnorm)
generate_slopes(10, sM, FUN = rtruncnorm,
mean = c(1, 1.2, 1.5),
sd = c(0.5, 0.7, 1),
a = 0.5,
b = 2.5)
# 10 items with slopes generated from a normal distributions with mean of 1
# and standard deviation of 0.2 with half of the items "reverse-keyed" on
# the trait "i"
sM <- make_scoring_matrix_aem(5, sequence = "simultaneous")
generate_slopes(10, sM, FUN = rnorm, mean = 1, sd = 0.2,
nReversed = 5, reverseTraits = "i")
# }
Run the code above in your browser using DataLab