[R] Question about package "principal"

William Revelle
2015-01-12T15:40:33Z

As David suggests, look at your data.  For instance, there seems to be only 1
case (#2) for seat.width.club with non-zero data.

I find it hard to believe that the other planes have seat.widths of 0!

I think you probably want to code the 0s as missing, rather than 0.

You also want to rethink the variables since some of them are almost completely
missing.


At least 3 of your variables are completely collinear (they correlate 1.0 to 5
decimals)

Seat.width and pitch in club all correlate 1.0.


> On Jan 11, 2015, at 1:59 PM, David Winsemius <dwinsemius at
comcast.net> wrote:
>
>
> On Jan 11, 2015, at 3:55 AM, ??? wrote:
>
>> Hi,
>>
>> I tried to run "principal" function in the 'psych'
package, but it failed
>> to do..
>>
>> here is both my code and error message.
>>
>> I searched on the web, but couldn't find the exact answer I wanted.
>>
>>> data<-read.csv("
>>
https://raw.githubusercontent.com/mylesmharrison/delta_PCA_kmeans/master/delta.csv
>> ",row.names=1)
>>
>>> airpca<-principal(data,nfactors=33,rotate="none")
>> Error in solve.default(model, r) :
>> system is computationally singular: reciprocal condition number
>> 7.05776e-17
>> In addition: Warning messages:
>> 1: In cor.smooth(model) :
>> Matrix was not positive definite, smoothing was done
>> 2: In cor.smooth(r) : Matrix was not positive definite, smoothing was
done
>
> Looks like your data is highly correlated in some of those columns:
>
>> dat[[1]]
> [1]  0.0 19.4  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
> [25]  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0
0.0  0.0  0.0  0.0  0.0  0.0
>> dat[[29]]
> [1] 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
>> dat[[2]]
> [1]  0 44  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
> [42]  0  0  0
>> dat[[3]]
> [1]  0 12  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
> [42]  0  0  0
>
> I'd retry after removing the problem columns.
>
>>
>> Thank you for your help.
>>
>> 	[[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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.
>
> David Winsemius
> Alameda, CA, USA
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

William Revelle		           http://personality-project.org/revelle.html
Professor			           http://personality-project.org
Department of Psychology   http://www.wcas.northwestern.edu/psych/
Northwestern University	   http://www.northwestern.edu/
Use R for psychology             http://personality-project.org/r
It is 5 minutes to midnight	   http://www.thebulletin.org