I KEEP GETTING THIS ERROR: Error in if ((!is.matrix(model)) | ncol(model) != 3) stop("model argument must be a 3-column matrix") :
argument is of length zero
sessionInfo()fit <- lavaan::sem(model, objectives, missing='fiml')--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
Look at your syntax. If the variables on the left hand side are supposed to be factors, then the operator between the two sides should be =~, not ~~. Without an =~, lavaan does not know that the left hand side variables are factors rather than observed variables.model <- '
temotion ~~ TSomatic + TWorries + TUnhappy + TClingy + TAfraid
tconduct ~~ TTantrum + TObeys + TFights + TLies + TSteals
thyper ~~ TRestles + TFidgety + TDistrac + TReflect + TAttends
tpeer ~~ TLoner + TFriend + TPopular + TBullied + TOldBest
tprosoc ~~ TConsid + TShares + TCaring + TKind + THelpOut
'
On Fri, Mar 3, 2017 at 9:12 AM, Terrence Jorgensen <tjorge...@gmail.com> wrote:
I KEEP GETTING THIS ERROR: Error in if ((!is.matrix(model)) | ncol(model) != 3) stop("model argument must be a 3-column matrix") :
argument is of length zeroThis does not look like lavaan. Check which packages you have loaded:sessionInfo()Did you also load the "sem" package, which has a different sem() function? If so, you can make sure to call lavaan's function explicitly:fit <- lavaan::sem(model, objectives, missing='fiml')If this isn't the problem, it may be necessary to post enough data to reproduce the error.Terrence D. JorgensenPostdoctoral Researcher, Methods and StatisticsResearch Institute for Child Development and Education, the University of AmsterdamUvA web page: http://www.uva.nl/profile/t.d.jorgensen
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
On 4 May 2017, at 12.11, Alexandra Kinnby <alexandr...@gmail.com> wrote:Hi,I get the same error message as posted above when I use the following model:model <- 'Nutrients =~ Nitrate + Phosphate + ChlNoAdvBran =~ NutrientsArea =~ NutrientsNoAdvBran ~ Area + Alkalinity + Salinity + TemperatureArea ~ Salinity + Temperature'fit <- sem(model, data = advWC)Error in if ((!is.matrix(model)) | ncol(model) != 3) stop("model argument must be a 3-column matrix") :argument is of length zeroDoes anyone know what I'm doing wrong?
NoAdvBran =~ NutrientsArea =~ Nutrients
Nutrients =~ Nitrate + Phosphate + Chl
On 4 May 2017, at 13.09, Alexandra Kinnby <alexandr...@gmail.com> wrote:When I use sem::sem I get the same error as before and when I use lavaan::sem I get the following error:Error in lav_model_estimate(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :lavaan ERROR: initial model-implied matrix (Sigma) is not positive definite;check your model and/or starting parameters.In addition: Warning messages:1: In lav_data_full(data = data, group = group, cluster = cluster, :lavaan WARNING: some observed variances are (at least) a factor 1000 times larger than others; use varTable(fit) to investigate2: In lav_samplestats_icov(COV = cov[[g]], ridge = ridge, x.idx = x.idx[[g]], :lavaan WARNING: sample covariance matrix is not positive-definite
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.