Skip to content
Prev 81299 / 398502 Next

How to assign the p value from >anova to a variable ?

Hi , 

If I need to assign the p-value from >anova(lm(y~x1*x2)) to a variable 
temp. How can I do that?
In other words, I need to let temp<-1.228e-07. I ever tried to use 
temp<-anova(lm(y~x1*x2))$Respone["x1:x2","Pr(>F)"], but it doesn't work. 
The result is like:
Analysis of Variance Table

Response: y
           Df Sum Sq Mean Sq  F value    Pr(>F)    
x1      1 0.1009  0.1009   8.7183   0.01835 *  
x2       1 0.5983  0.5983  51.6845 9.343e-05 ***
x1:x2  1 3.4940  3.4940 301.8363 1.228e-07 ***
Residuals   8 0.0926  0.0116   

Any idea is appreiciated, thanks a lot!
Fay