d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Principal Component Analysis In R
Add Reply New Topic New Poll
Member
Posts: 6,015
Joined: Jul 9 2008
Gold: 1,900.00
Nov 26 2014 05:07pm
hi,

I'm having trouble understanding what to do after I get my principal component analysis scores.

after getting the scores I combined the data with the rest of my dataset and now I'm supposed to create models.

the part I'm stuck on is what to include in these models and why...

so far this is what I have from looking at other people's work but if it could be explained to me what I'm doing that would be very helpful.

this is an example of what the other work looks like:

model1<-lm(larvaweight.mg~Comp1*Comp2*Comp3)
model2<-lm(larvaweight.mg~Comp1*Comp2+Comp3)
model3<-lm(larvaweight.mg~Comp1+Comp2+Comp3)
model4<-lm(larvaweight.mg~Comp1)
etc...

my questions are:
1. what am I supposed to be putting in the brackets just after lm?
2. why am I sometimes multiplying and sometimes adding the different components? what do they mean?


if my instructions are:
Retain a sufficient number of PC’s that explain a “meaningful” (as determined by
you) amount of the total variation in your data set. Describe your new ordination
system via the interpretation of loadings.

Using your re-scored variables as the response variables compare the mean (or
median*) heights of pairs of parasitized and unparasitized goldenrods in your
sample. *Please use the appropriate statistical test(s) for the above analyses, and
indicate in your report why the test(s) you used were appropriate.
Produce a boxplot illustrating the difference in “size” of the pairs of unparasitized
and parasitized goldenrods.

so I know the sufficient number of PC's that explain a meaningful amount of total variation in my dataset is the first 3 components, how am I supposed to describe my new ordination system and how do I interpret the loadings?

any help will be much appreciated! I happened to miss this class and only have notes on factor analysis :(
Member
Posts: 6,835
Joined: Apr 17 2010
Gold: 6,315.51
Nov 26 2014 06:59pm
lm fits linear models in R. see https://stat.ethz.ch/R-manual/R-devel/library/stats/html/lm.html
lm(Y~X) is the linear fit Y = aX+b.
PCA means that you'll take the keep the more meaningful factors and then fit them linearly with R (factor selection).
if you know that your 3 most meaningful factors are the first 3 you do the regression Y = a + bX1 + cX2 + dX3 using lm in R.
Member
Posts: 6,015
Joined: Jul 9 2008
Gold: 1,900.00
Nov 26 2014 08:38pm
Quote (HbSoe @ Nov 26 2014 07:59pm)
lm fits linear models in R. see https://stat.ethz.ch/R-manual/R-devel/library/stats/html/lm.html
lm(Y~X) is the linear fit Y = aX+b.
PCA means that you'll take the keep the more meaningful factors and then fit them linearly with R (factor selection).
if you know that your 3 most meaningful factors are the first 3 you do the regression Y = a + bX1 + cX2 + dX3 using lm in R.


ahh ok I think I need it broken down even more

so for regression Y = a + bX1 + cX2 + dX3 , what would a be? is it just any one of my variables or will I have to test for every single one? also bX1 cX2 and dX3 are all just the same as Comp.1 Comp.2, and Comp.3 right? where does the multiplication come in? I've been seeing a lot of notes for Comp.1*Comp.2*Comp.3
I don't understand what is meant by lm(Y~X) is the linear fit Y=aX+b, can you explain this?

thanks so much for the help

This post was edited by MOMOtheflyingLEMUR on Nov 26 2014 08:52pm
Member
Posts: 6,015
Joined: Jul 9 2008
Gold: 1,900.00
Nov 27 2014 12:46pm
ok different question: so I've decided to just copy what the example up there is with the larvaweight. how do I decide how many models to create??
Go Back To Homework Help Topic List
Add Reply New Topic New Poll