
```{r}
#| label = "Plot{{DataName}}",
#| fig.cap = ""
{{DataName}} |> ggplot(aes(y={{ResponseName}}, x={{PredictorName}})) + geom_point() + geom_smooth()
```




```{r}
#| label = "{{DataName}}.poly"
{{DataName}}.poly1  <- lm({{ResponseName}} ~ {{PredictorName}}, data = DataName)
{{DataName}}.poly2 <- lm({{ResponseName}} ~ poly({{PredictorName}}, 2, raw=TRUE), data = DataName)
{{DataName}}.poly3 <- lm({{ResponseName}} ~ poly({{PredictorName}}, 3, raw=TRUE), data = DataName)
{{DataName}}.poly4 <- lm({{ResponseName}} ~ poly({{PredictorName}}, 4, raw=TRUE), data = DataName)
anova({{DataName}}.poly1, {{DataName}}.poly2, {{DataName}}.poly3, {{DataName}}.poly4)
```


```{r}
#| label = "plot{{DataName}}.lm",
#| fig.cap = "Residual analysis for {{DataName}}.poly"
library(ggfortify)
# should really change the following to the preferred model
{{DataName}}.poly4 |> autoplot()
```
