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 column by its deviation, 
so thats not exactly it, though it seems to fix the problem. 

Something like this:

normalize<-function(dataVec,n=1){
        max<-max(dataVec,na.rm=T);
        min<-min(dataVec,na.rm=T);
        newVec<-(dataVec-min)^n/(max-min)^n;
        return(newVec);
}

should scale a column to 0,1 - But as i said, not sure if it is whats wanted 
here ;)
Now that i'm at my normalize function, another idea would be to have the column 
vector have a length of 1
(in the sqrt(sum(vec^2)) sense)

- In the end i don't know whats exactly meant either -

On 11.07.2012, at 05:11, Jeremy Little wrote:

> 
> 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 having range
> the order of one"
> Â…actually means.
> 
> Regardless, the script you have supplied works for my data and looks (at
> this point) like a suitable solution.
> 
> Many many thanks for your time in resolving this issue.
> 
> 
> ############
> 
> Dear Rune,
> 
> thank you for your valuable input.
> 
> I used the package 'ordinal' originally for this ordinal logistic regression
> and this package was straight forward and worked fine without any errors.
> 
> However, I switched to using 'MASS', as I need to run these models through
> an additional package 'AICcmodavg', which requires the 'MASS' inputs. Hence,
> I have needed the models to work in 'MASS'.
> 
> The str(Jdata) call gives the following:
> 
>> str(Jdata)
> 'data.frame': 552270 obs. of  17 variables:
> $ POINTID    : int  582358 582360 582361 582359 35289 582357 582362 411225
> 584336 584493 ...
> $ Lat_Y_pos  : num  19.7 19.7 19.7 19.7 16 ...
> $ JVeg5      : Factor w/ 5 levels "1RF","2WSFEG",..: 5 5 5 5 1 5 5 5 5 5
> ...
> $ Subregion  : Factor w/ 47 levels "AU-BF","AU-BK",..: 16 16 46 16 8 16 46
> 28 46 46 ...
> $ Rock_U_Nam : Factor w/ 607 levels "Adler Hill Basalt",..: 33 33 33 33 173
> 33 33 585 112 112 ...
> $ Rock_Name  : Factor w/ 32 levels "ALLUVIUM","ARENITE",..: 13 13 13 13 25
> 13 13 10 23 23 ...
> $ Elevation  : num  317 230 180 317 107 ...
> $ Slope      : num  35.5 44.7 39.1 43.5 23 ...
> $ Aspect     : num  25.3 3.68 30.83 4.02 254.66 ...
> $ Hillshade  : int  182 211 167 212 200 218 216 245 214 27 ...
> $ Stream_dist: num  4241 4288 4330 4252 2160 ...
> $ Coast_dist : num  39497 39128 38883 39312 5601 ...
> $ Coast_SE   : num  404751 404821 404468 404680 28426 ...
> $ Coast_E    : int  78000 77500 77250 77750 15550 78250 77000 55650 77000
> 76800 ...
> $ Wind_310   : int  10 10 10 10 10 10 10 10 2 10 ...
> $ TPI        : num  -122.6 -109 -95.9 -94.7 -76.6 ...
> $ Landform   : int  1 1 1 1 1 1 1 1 1 1 ...
> 
> Does this provide any insight?
> 
> Thank you
> ##########
> 
> Thank you both for your generous time and support, it is greatly
> appreciated.
> 
> kind regards
> 
> Jeremy
> 
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Package-MASS-polr-Error-in-svd-X-infinite-or-missing-values-in-x-tp4635829p4636091.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.


        [[alternative HTML version deleted]]

______________________________________________
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