[R] sim() not working in example given in lava() documentation - please help.
John Hillier
J.Hillier at lboro.ac.uk
Mon Sep 5 14:19:23 CEST 2016
Dear All,
I am trying to simulate using a statistical model created in the lava() package. My model gave the error message "Error in rep(0, ncol(fx)) : invalid 'times' argument". So, I used the example in the documentation for the lava() package - v1.4.4, on page 79; this is copied below with the output. It did the same thing.
I can plot and view the model, so it appears to have been created correctly.
I am relative new to this, so don't have a good idea of where to start when a standard example fails like this. I have tried naive fiddling with the code, and Googling. Any advice would be much appreciated.
Thank you
John
> ##################################################
> ## Logistic regression
> ##################################################
> m <- lvm(y~x+z)
> regression(m) <- x~z
> distribution(m,~y+z) <- binomial.lvm("logit")
> d <- sim(m,1e3)
Error in rep(0, ncol(fx)) : invalid 'times' argument
-------------------------
Dr John Hillier
Senior Lecturer - Physical Geography
Loughborough University
01509 223727
[[alternative HTML version deleted]]
More information about the R-help
mailing list