hello R_team

having perfomed a PCA on my fitted model with the function:

data<- na.omit(dataset) 

data.pca<-prcomp(data,scale =TRUE),

I´ve decided to aggregate two variables that are highly correlated.

My first question is:

How can I combine the two variables into one new predictor?

and secondly:

How can I predict with the newly created variable in a new dataset? 

Guess I need the "predict" and "new data" command but I´m having problems with 
the syntax and the help function was not sufficient on this issue.

many thanks in advance

Christian



 



        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to