Fernando Marmolejo Ramos wrote:
Dear R members

Could someone indicate me how to simulate Likert-type data using the GAMLSS
library and how to fit that data?

Let’s say, 50 random numbers in a variable that goes from -4 to +4 in steps of
1 (i.e., -4, -3, -2, -1, 0, 1, 2, 3, 4) with a mean of 2 and SD of 0.15 and
belonging to a normal distribution?

Hi Fernando,
You can get something like a truncated normal (in the sense of, "If I squint my eyes right down, it looks kind of normal") sample with:

sample(-4:4,50,TRUE,prob=c(pnorm(-4:2,)pnorm(c(3,4),2,lower.tail=FALSE))

but it will not pass any of the usual tests for normal distribution.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to