I ran this to get the intercepts and the r squared.
m0 <- lm(kg.ha ~ 1,LAIDat)
m1 <- lm(kg.ha ~ LAI, LAIDat)
summary(m1)
##
## Call:
## lm(formula = kg.ha ~ LAI, data = LAIDat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -840.54 -165.06 3.15 152.27 848.19
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 365.01 67.16 5.435 6.21e-07 ***
## LAI 366.73 26.86 13.653 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 303 on 77 degrees of freedom
## Multiple R-squared: 0.7077, Adjusted R-squared: 0.7039
## F-statistic: 186.4 on 1 and 77 DF, p-value: < 2.2e-16
anova(m0,m1)
## Analysis of Variance Table
##
## Model 1: kg.ha ~ 1
## Model 2: kg.ha ~ LAI
## Res.Df RSS Df Sum of Sq F Pr(>F)
## 1 78 24186403
## 2 77 7070635 1 17115768 186.39 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Val <- read.csv("C:/Users/micayla.lakey/Desktop/R/data/validpts.csv")
Val$kg.ha<-with(Val, biomass*4.325)
predbio.gg <- ggplot(data=Val, aes(x=LAI, y=366.73*LAI+365.01))+
geom_point(color="orange") +
theme_bw(20)+
labs(x="Leaf Area Index (LAI)",
y="Predicted Biomass")
predbio.gg +
geom_smooth(method = "lm",se=FALSE, color="green") +
ggtitle("Predicted Biomass of Validation Samples")
Val <- read.csv("C:/Users/micayla.lakey/Desktop/R/data/validpts.csv")
Val$kg.ha<-with(Val, biomass*4.325)
pvabio.gg <- ggplot(data=Val, aes(x=366.73*LAI+365.01, y=kg.ha))+
geom_point(color="orange") +
theme_bw(20)+
labs(x="Predicted Biomass (kg/ha)",
y="Actual Biomass (kg/ha)")
pvabio.gg +
geom_smooth(method = "lm",se=FALSE, color="green") +
ggtitle("Predicted Biomass vs. Actual biomass")+
annotate("text", x=600, y=750, label="paste(R^2,\"=0.70\")",
parse=TRUE, size=5)