From ca89c22741a53d6d917263d5b9b61b3051355fea Mon Sep 17 00:00:00 2001 From: Matthew Hendrickson Date: Wed, 20 Jun 2018 05:12:29 -0400 Subject: [PATCH] line 188 - typo - delete 'is' (#672) Line read "...because it's is a special..." Removed typo "is" --- model-basics.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model-basics.Rmd b/model-basics.Rmd index 4eda66a..20dee1d 100644 --- a/model-basics.Rmd +++ b/model-basics.Rmd @@ -185,7 +185,7 @@ ggplot(sim1, aes(x, y)) + Don't worry too much about the details of how `optim()` works. It's the intuition that's important here. If you have a function that defines the distance between a model and a dataset, an algorithm that can minimise that distance by modifying the parameters of the model, you can find the best model. The neat thing about this approach is that it will work for any family of models that you can write an equation for. -There's one more approach that we can use for this model, because it's is a special case of a broader family: linear models. A linear model has the general form `y = a_1 + a_2 * x_1 + a_3 * x_2 + ... + a_n * x_(n - 1)`. So this simple model is equivalent to a general linear model where n is 2 and `x_1` is `x`. R has a tool specifically designed for fitting linear models called `lm()`. `lm()` has a special way to specify the model family: formulas. Formulas look like `y ~ x`, which `lm()` will translate to a function like `y = a_1 + a_2 * x`. We can fit the model and look at the output: +There's one more approach that we can use for this model, because it's a special case of a broader family: linear models. A linear model has the general form `y = a_1 + a_2 * x_1 + a_3 * x_2 + ... + a_n * x_(n - 1)`. So this simple model is equivalent to a general linear model where n is 2 and `x_1` is `x`. R has a tool specifically designed for fitting linear models called `lm()`. `lm()` has a special way to specify the model family: formulas. Formulas look like `y ~ x`, which `lm()` will translate to a function like `y = a_1 + a_2 * x`. We can fit the model and look at the output: ```{r} sim1_mod <- lm(y ~ x, data = sim1)