library(tidyverse)url <-"https://raw.githubusercontent.com/jlacasa/stat705_fall2024/main/classes/data/lotus_part2.csv"dd <-read.csv(url)dd %>%filter(species %in%c("A")) %>%ggplot(aes(doy, crown_g))+geom_point(shape =21, size =3.5, fill ="black")+labs(x ="Day of the Year", y ="Crown biomass (g)", fill ="Treatment")+theme_classic()+theme(aspect.ratio =1)
Call:
lm(formula = crown_g ~ doy, data = dd)
Residuals:
Min 1Q Median 3Q Max
-0.4178 -0.1364 -0.0201 0.1081 0.7966
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.3722453 0.1363156 -10.07 5.51e-16 ***
doy 0.0091941 0.0006899 13.33 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.1961 on 82 degrees of freedom
Multiple R-squared: 0.6841, Adjusted R-squared: 0.6803
F-statistic: 177.6 on 1 and 82 DF, p-value: < 2.2e-16
dd %>%filter(species %in%c("A")) %>%ggplot(aes(doy, crown_g))+stat_function(fun =function(x){coef(m1)[1] +coef(m1)[2]*x })+geom_point(shape =21, size =3.5, fill ="black")+labs(x ="Day of the Year", y ="Crown biomass (g)", fill ="Treatment")+theme_classic()+theme(aspect.ratio =1)