You could probably make them numeric, like
v-c(a,a,b,c)
f-factor(v)
as.numeric(f)
[1] 1 1 2 3
to get a numeric rock_id, but i wouldn't per se recommend it.
You should ask someone who knows more about the scientific side of this method
to tell you how factorial data is properly treated.
Dear Jessica
thank you for the scale solution to my problem.
I tried to manually scale my data (scaling up and removing decimals),
however, this resulted in the same error message.
It remains vague to me what the precise meaning of...
the model matrix should be sensibly scaled with all columns
I'm not sure either, the wordings starnge and english isn't my primary language
I would GUESS, that it means that all columns values should be between 0,1 or
1,2 or -0.5,0.5 or something like that. The scale function scales the columns
to be comparable between each other, by dividing each
Thanks Jessi,
your insights are extremely helpful.
If you would indulge me one more quick question on your script.
You have written...
newData-data.frame(JVeg5=factor(Jdata[,JVeg5]),scale(Jdata[,c(Elevation,Lat_Y_pos,Coast_dist,Stream_dist)]))
I wish to expand this analysis for all other
Hi Jeremy,
newData-data.frame(JVeg5=factor(Jdata[,JVeg5]),scale(Jdata[,c(Elevation,Lat_Y_pos,Coast_dist,Stream_dist)]))
Global - polr(JVeg5 ~ Elevation + Lat_Y_pos + Coast_dist + Stream_dist,
data=newData, na.action = na.omit, Hess = TRUE)
summary(Global)
Does this still do
Hi Jeremy,
I think Jessica is right that probably you could make polr converge
and produce a Hessian if the data are better scaled, but there might
also be other things not allowing you to get the Hessian/vcov. Could
be insightful if you showed us the result of
str(Jdata)
Also, I am thinking
Hello,
I am trying to run an ordinal logistic regression (polr) using the package
'MASS'.
I have successfully run other regression classes (glm, multinom) without
much problem, but with the 'polr' class I get the following error:
Error in svd(X) : infinite or missing values in 'x'
which
Since its something about the Hessian, and occurs in the vcov() call, have you
thought about the note:
The vcov method uses the approximate Hessian: for reliable results the model
matrix should be sensibly scaled with all columns having range the order of
one.
?
I'm sorry i can't help you
Hi Jessica,
thank you for your prompt response. Yes I had deduced it had to do with the
Hessian.
However, I am not clear what all columns having range the order of one
actually means and what this means for my data. Does this mean removing
decimals (ie by shifting the decimal place)?
I would
9 matches
Mail list logo