Skip to content

Commit

Permalink
edits to vignette; re-build pkgdown
Browse files Browse the repository at this point in the history
  • Loading branch information
friendly committed Sep 20, 2022
1 parent ecafa87 commit de77bff
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 8 deletions.
60 changes: 52 additions & 8 deletions docs/articles/uni-vs-multi.html

Large diffs are not rendered by default.

Binary file modified docs/articles/uni-vs-multi_files/figure-html/dfbetas-plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/uni-vs-multi_files/figure-html/inflplot-mlm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/uni-vs-multi_files/figure-html/inflplot-mlm-lr-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/uni-vs-multi_files/figure-html/inflplots-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/uni-vs-multi_files/figure-html/inflplots-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/uni-vs-multi_files/figure-html/scatmat-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions extra/Toy.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ coef(Toy.lm1)
coef(Toy.lm2)
coef(Toy.mlm)

# or, using broom::tidy
broom::tidy(Toy.lm1)
broom::tidy(Toy.lm2)
broom::tidy(Toy.mlm)

broom::glance(Toy.lm1)
broom::glance(Toy.lm2)
# But there is no glance method for an mlm
# broom::glance(Toy.mlm)



# Cook's distance
df <- Toy
df$D1 <- cooks.distance(Toy.lm1)
df$D2 <- cooks.distance(Toy.lm2)
Expand Down
19 changes: 19 additions & 0 deletions vignettes/uni-vs-multi.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,25 @@ Toy.lm2 <- lm(y2 ~ x, data=Toy)
Toy.mlm <- lm(cbind(y1, y2) ~ x, data=Toy)
```

Note that the coefficients in the multivariate model `Toy.mlm` are identical to those in the separate
univariate models for `y1` and `y2`. That is,
$\mathbf{B} = [ \mathbf{b_{y1}} , \mathbf{b_{y2}} ]$, as if the univariate models were fit individually.

```{r coefs}
coef(Toy.lm1)
coef(Toy.lm2)
coef(Toy.mlm)
```

However, the test for predictors differ, because the multivariate tests take the correlation between `y1` and `y2` into account.

```{r anovas}
car::Anova(Toy.lm1)
car::Anova(Toy.lm2)
car::Anova(Toy.mlm)
```


### Cook's D

First, let's examine the Cook's D statistics for the models. Note that the function `cooks.distance()`
Expand Down

0 comments on commit de77bff

Please sign in to comment.