
```{r}
#| label = "DataNamePlot",
#| fig.cap = "Plot of {{ResponseName}} versus {{PredictorName}} with fitted
#| line added."
library(ggplot2)
{{DataName}} |> ggplot(aes(y=ResponseName, x=PredictorName)) + geom.point() + geom_smooth(method="lm")
```

```{r}
#| label = "{{DataName}}.lm"
{{DataName}}.lm = lm({{ResponseName}} ~ {{PredictorName}}, data={{DataName}})
library(broom)
{{DataName}}.lm.aug = {{DataName}}.lm |> augment()
{{DataName}}.lm |> summary()
```


```{r}
#| label = "glance{{DataName}}.lm"
{{DataName}}.lm |> glance() |> kable(caption="Summary statistics for {{DataName}}.lm.")
```

```{r}
#| label = "plot{{DataName}}.lm",
#| fig.cap = "Residual analysis for {{DataName}}.lm"
library(ggfortify)
{{DataName}}.lm |> autoplot()
```
