class: center, middle, title-slide, inverse, no-scribble layout: false background-image: url("media/halloween_pumpkin.jpg") background-size: cover # Categorical predictors: Comparing means ## Professor Andy Field <div> <img style="vertical-align:middle; width:30px; height:30px" src="media/twitter_60.png"> <span style="line-height:40px;">@profandyfield</span> </div> <div> <img style="vertical-align:middle; width:60px" src="media/youtube.png"> <span style="line-height:40px;">www.youtube.com/user/ProfAndyField/</span> </div> <div> <img style="vertical-align:middle; width:30px; height:30px" src="media/ds_com_fav.png"> <span style="line-height:40px;">www.discoveringstatistics.com</span> </div> <div> <img style="vertical-align:middle; width:30px; height:30px" src="media/milton_grey_fav.png"> <span style="line-height:40px;">www.milton-the-cat.rocks</span> </div> <div> <img style="vertical-align:middle; width:30px; height:30px" src="media/discovr_fav.png"> <span style="line-height:40px;">www.discovr.rocks</span> </div> ??? h or ?: Toggle the help window j: Jump to next slide k: Jump to previous slide b: Toggle blackout mode m: Toggle mirrored mode. p: Toggle PresenterMode f: Toggle Fullscreen t: Reset presentation timer <number> + <Return>: Jump to slide <number> c: Create a clone presentation on a new window --- class: inverse, no-scribble background-image: url("media/hell_fire_background.jpg") background-size: cover <audio controls> <source src="media/helloween_narrative.mp3" type="audio/mpeg"> <source src="media/helloween_narrative.ogg" type="audio/ogg"/> </audio> <style>p {font-size: 24px; font-weight: bold;}</style> .center[Every Halloween the zombies and werewolves gather in an underground tomb. They don’t like Halloween because it’s the one night that they can’t scare humans. On Halloween everyone thinks that they are a small child in fancy dress. So they gather underground and bemoan how scary small children are these days. Invariably they quarrel about who is the scariest. The zombies argue that they are scariest because they look rotten, but the Werewolves believe that they are scariest because they have big teeth. The zombies think the Werewolves look too cuddly. Each year Azal, head of the Werewolves becomes so enraged that he eats all of the zombies to win the argument. They taste rotten too. This year, the zombies are fighting back …] --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_azal_lecture_intro.mp4" type="video/mp4"> </video> --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_01.mp4" type="video/mp4"> </video> ??? C: .... you look awful AF: Well, it's been a long term etc. --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_02.mp4" type="video/mp4"> </video> ??? C: Is it true that you are the graetest statistician in the land? AF: Well, on a good day I'm barely adequate. But I am cheap, and I am available. --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_03.mp4" type="video/mp4"> </video> ??? C: .... can you do it? AF: yes, sure, leave it with me ... byE! --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_04.mp4" type="video/mp4"> </video> ??? C: Thank you --- class: center class: center  ??? We've seen this map of the process of fitting models before --- class: center  ??? Today we focus back on the model itself to look at the form of the model we're fitting. The faded stuff still applies though - we'll look at bias, robust models, and of course samples and estimation and so on. But they are the same as for other models, what is different is the form of the model we're fitting. --- .ong_dk[ $$ `\begin{aligned} \text{ringing}_i &= \hat{b}_0 + \hat{b}_1\text{volume}_{i} + e_i \end{aligned}` $$ ] .pull-left[  ] .pull-right[  ] ??? We've seen a few times already that when we enter categorical predictors into the GLM, their parameters represent differences between means. For example, we looked at how attending a concert affected how long people experienced ringing ears. --- class: center .ong_dk[ $$ `\begin{aligned} \text{ringing}_i &= \hat{b}_0 + \hat{b}_1\text{musician}_{i} + e_i \end{aligned}` $$ ] -- <!-- --> --- class: center .ong_dk[ $$ `\begin{aligned} \text{ringing}_i &= \hat{b}_0 + \hat{b}_1\text{musician}_{i} + e_i \end{aligned}` $$ ] <!-- --> --- class: center .ong_dk[ $$ `\begin{aligned} \text{ringing}_i &= \hat{b}_0 + \hat{b}_1\text{musician}_{i} + e_i \end{aligned}` $$ ] <!-- --> ??? b1 represents the differences between means --- # The GLM and experiments * In experimental research, predictors in the linear model are defined by a manipulation + By manipulating a predictor variable can we cause (and therefore predict) a change in behaviour? -- * The *F*-statistic + Still quantifies the fit of the model to the data + Still has an associated significance test + The 'fit' represents the experimental manipulation (which defines the predictor) + 'Significant' fit equates to a 'significant' effect of the experimental manipulation --- class: center, middle, title-slide, inverse layout: false ## A ghoulish example --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/zombie_prank.mp4" type="video/mp4"> </video> --- .pull-left[  ] .pull-right[ ## Same ghoul <!-- --> ] --- .pull-left[  ] .pull-right[ ## Same ghoul <!-- --> ] --- .pull-left[  ] .pull-right[ ## Different ghouls <!-- --> ] ---
--- .pull-left[ # The model .ong_dk[ $$ `\begin{aligned} Y_i &= \hat{b}_0 + \hat{b}_1X_{i} + e_i \\ \text{Fear}_i &= \hat{b}_0 + \hat{b}_1\text{Costume}_{i} + e_i \end{aligned}` $$ ]] .pull-right[ <!-- --> ] --- .pull-left[ # The model .ong_dk[ $$ `\begin{aligned} Y_i &= \hat{b}_0 + \hat{b}_1X_{i} + e_i \\ \text{Fear}_i &= \hat{b}_0 + \hat{b}_1\text{Costume}_{i} + e_i \end{aligned}` $$ ] ] .pull-right[ <!-- --> ] ??? The intercept represents the mean of the control group --- .pull-left[ # The model .ong_dk[ $$ `\begin{aligned} Y_i &= \hat{b}_0 + \hat{b}_1X_{i} + e_i \\ \text{Fear}_i &= \hat{b}_0 + \hat{b}_1\text{Costume}_{i} + e_i \\ \hat{\text{Fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Costume}_{i} \\ \end{aligned}` $$ ] ] .pull-right[ <!-- --> ] ??? b_1 represents the difference between group means --- # Dummy coding: *b*<sub>0</sub> * Dummy Coding + Zombie = 0, Werewolf = 1 * When costume = zombie + Costume = 0 + Predicted fear = mean of zombie group: .center[ .eq_lrge[ .ong[ $$ `\begin{aligned} \hat{\text{fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Costume}_i \\ \bar{X}_\text{zombie} &= \hat{b}_0 + \hat{b}_1\times0 \\ \bar{X}_\text{zombie} &= \hat{b}_0 \end{aligned}` $$ ] ] ] --- # Dummy coding: *b*<sub>1</sub> * When costume = werewolf + Costume = 1 + Predicted fear = mean of werewolf group: .center[ .eq_lrge[ .ong[ $$ `\begin{aligned} \hat{\text{fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Costume}_i \\ \bar{X}_\text{werewolf} &= \hat{b}_0 + \hat{b}_1\times1 \\ \bar{X}_\text{werewolf} &= \hat{b}_0 + \hat{b}_1 \end{aligned}` $$ ] ] ] -- .center[ .eq_lrge[ .ong[ $$ `\begin{aligned} \bar{X}_\text{werewolf} &= \bar{X}_\text{zombie} + \hat{b}_1 \\ \hat{b}_1 &= \bar{X}_\text{werewolf} - \bar{X}_\text{zombie} \end{aligned}` $$ ] ] ] --- # The linear model * We can fit a linear model with fear as the outcome and the type of costume (zombie or werewolf) as the predictor, note: + Intercept (*b*<sub>0</sub>) is the mean of ‘zero coded’ group + *b* for the dummy variable is the difference between the means of the two costume groups (4.5 − 7 = −2.5) -- ```r zombie_lm <- lm(Fear ~ Costume, zombie_tib) broom::tidy(zombie_lm, conf.int = TRUE) ``` <table> <thead> <tr> <th style="text-align:left;"> term </th> <th style="text-align:right;"> estimate </th> <th style="text-align:right;"> std.error </th> <th style="text-align:right;"> statistic </th> <th style="text-align:right;"> p.value </th> <th style="text-align:right;"> conf.low </th> <th style="text-align:right;"> conf.high </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> (Intercept) </td> <td style="text-align:right;"> 7.0 </td> <td style="text-align:right;"> 0.299 </td> <td style="text-align:right;"> 23.400 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> 6.406 </td> <td style="text-align:right;"> 7.594 </td> </tr> <tr> <td style="text-align:left;"> CostumeWerewolf </td> <td style="text-align:right;"> -2.5 </td> <td style="text-align:right;"> 0.423 </td> <td style="text-align:right;"> -5.909 </td> <td style="text-align:right;"> 0 </td> <td style="text-align:right;"> -3.340 </td> <td style="text-align:right;"> -1.660 </td> </tr> </tbody> </table> --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_azal_lecture_middle_captioned.mp4" type="video/mp4"> </video> --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_05.mp4" type="video/mp4"> </video> ??? C: Hello, it is I, Cubit Zenom, King of the zombies. AF: Hi. --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_06.mp4" type="video/mp4"> </video> ??? C: I took your results to Azal and he said you have done a foolish thing. AF: Really? --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_07.mp4" type="video/mp4"> </video> ??? C: I need you to take another look. AF: Ok, leave it with me. --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_facetime_live_lecture_08.mp4" type="video/mp4"> </video> ??? C: Bye! --- background-image: url("media/halloween_pumpkin_house.jpg") background-size: cover class: inverse # Another ghoulish example * Which is more scary? + Human + Zombie + Werewolf * Design + Prank * Outcome + Fear    --- # The data
Human
Zombie
Werewolf
2
10
6
6
8
3
1
5
0
1
7
2
2
6
8
Mean
2.40
7.20
3.80
Variance (<i>s</i><sup>2</sup>)
4.30
3.70
10.20
Standard deviation (<i>s</i>)
2.07
1.92
3.19
<br> .center[ .eq_lrge[ .ong[ `\(\text{Overall mean (} \bar{X}_\text{grand}\text{)} = 4.47\)` ] ] ] --- class: center # The model <!-- --> --- class: center # The model <!-- --> --- # Testing the model ## Overall fit (*F*-statistic) * The ratio of how well the model fits to how much error it has * In the case of experiments: + The model = differences between means + *F* is the ratio of the experimental effect to the background ‘error’ + Tests whether group means differ **overall** ## Parameter estimates (and *t*-tests) * Break down the overall fit * Tell us, specifically, which means differ --- # Total sum of squared error, SS<sub>T</sub> .center[ <!-- --> ] --- # Total sum of squared error, SS<sub>T</sub> .center[ <!-- --> ] --- # Residual sum of squared error, SS<sub>R</sub> .center[ <!-- --> ] --- # Residual sum of squared error, SS<sub>R</sub> .center[ <!-- --> ] --- # Model sum of squared error, SS<sub>M</sub> .center[ <!-- --> ] --- # Model sum of squared error, SS<sub>M</sub> .center[ <!-- --> ] --- # Model sum of squared error, SS<sub>M</sub> .center[ <!-- --> ] --- # Dummy coding multiple categories * You can code any categorical predictor into a series of dummy variables + Dummy variables must be entered in the same block + Choose a baseline category - it is always coded as 0 - (By default <svg style="height: 1em; top:.04em; position: relative; fill: #136CB9;" viewBox="0 0 581 512"><path d="M581 226.6C581 119.1 450.9 32 290.5 32S0 119.1 0 226.6C0 322.4 103.3 402 239.4 418.1V480h99.1v-61.5c24.3-2.7 47.6-7.4 69.4-13.9L448 480h112l-67.4-113.7c54.5-35.4 88.4-84.9 88.4-139.7zm-466.8 14.5c0-73.5 98.9-133 220.8-133s211.9 40.7 211.9 133c0 50.1-26.5 85-70.3 106.4-2.4-1.6-4.7-2.9-6.4-3.7-10.2-5.2-27.8-10.5-27.8-10.5s86.6-6.4 86.6-92.7-90.6-87.9-90.6-87.9h-199V361c-74.1-21.5-125.2-67.1-125.2-119.9zm225.1 38.3v-55.6c57.8 0 87.8-6.8 87.8 27.3 0 36.5-38.2 28.3-87.8 28.3zm-.9 72.5H365c10.8 0 18.9 11.7 24 19.2-16.1 1.9-33 2.8-50.6 2.9v-22.1z"/></svg> chooses the first level of the factor) + The *b* for each dummy variable will be the difference in means between each category and the baseline <br> -- .center[ <table> <thead> <tr> <th style="text-align:left;"> Entity </th> <th style="text-align:center;"> Dummy 1 (Zombie vs. Human) </th> <th style="text-align:center;"> Dummy 2 (Werewolf vs. Human) </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Human </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Zombie </td> <td style="text-align:center;"> 1 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Werewolf </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 1 </td> </tr> </tbody> </table> ] -- .center[.eq_lrge[.ong[ $$ `\begin{aligned} \hat{\text{Fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Zombie vs. Human}_i + \hat{b}_2\text{Werewolf vs. Human}_i \end{aligned}` $$ ]]] --- # Dummy coding: *b*<sub>0</sub> .pull-left[ * When entity = human + Zombie vs. Human = 0 + Wolf vs. Human = 0 * Predicted fear = mean of human group: ] .pull-right[ <table> <thead> <tr> <th style="text-align:left;"> Entity </th> <th style="text-align:center;"> Zombie vs. Human </th> <th style="text-align:center;"> Werewolf vs. Human </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Human </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Zombie </td> <td style="text-align:center;"> 1 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Werewolf </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 1 </td> </tr> </tbody> </table> ]  -- .eq_lrge[.ong[ $$ `\begin{aligned} \hat{\text{Fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Zombie vs. Human}_i + \hat{b}_2\text{Werewolf vs. Human}_i \\ \bar{X}_\text{human} &= \hat{b}_0 + \hat{b}_1\times 0 + \hat{b}_2\times 0 \\ \hat{b}_0 &= \bar{X}_\text{human} \end{aligned}` $$ ]] --- # Dummy coding: *b*<sub>1</sub> .pull-left[ * When entity = zombie + Zombie vs. Human = 1 + Wolf vs. Human = 0 * Predicted fear = mean of zombie group: ] .pull-right[ <table> <thead> <tr> <th style="text-align:left;"> Entity </th> <th style="text-align:center;"> Zombie vs. Human </th> <th style="text-align:center;"> Werewolf vs. Human </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Human </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Zombie </td> <td style="text-align:center;"> 1 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Werewolf </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 1 </td> </tr> </tbody> </table> ]  -- .eq_lrge[.ong[ $$ `\begin{aligned} \hat{\text{Fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Zombie vs. Human}_i + \hat{b}_2\text{Werewolf vs. Human}_i \\ \bar{X}_\text{zombie} &= \hat{b}_0 + \hat{b}_1\times 1 + \hat{b}_2\times 0 \\ \bar{X}_\text{zombie} &= \hat{b}_0 + \hat{b}_1 \\ \hat{b}_1 &= \bar{X}_\text{zombie}- \hat{b}_0 \\ &= \bar{X}_\text{zombie}- \bar{X}_\text{human} \end{aligned}` $$ ]] --- # Dummy coding: *b*<sub>2</sub> .pull-left[ * When entity = werewolf + Zombie vs. Human = 0 + Wolf vs. Human = 1 * Predicted fear = mean of werewolf group: ] .pull-right[ <table> <thead> <tr> <th style="text-align:left;"> Entity </th> <th style="text-align:center;"> Zombie vs. Human </th> <th style="text-align:center;"> Werewolf vs. Human </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> Human </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Zombie </td> <td style="text-align:center;"> 1 </td> <td style="text-align:center;"> 0 </td> </tr> <tr> <td style="text-align:left;"> Werewolf </td> <td style="text-align:center;"> 0 </td> <td style="text-align:center;"> 1 </td> </tr> </tbody> </table> ]  -- .eq_lrge[.ong[ $$ `\begin{aligned} \hat{\text{Fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Zombie vs. Human}_i + \hat{b}_2\text{Werewolf vs. Human}_i \\ \bar{X}_\text{werewolf} &= \hat{b}_0 + \hat{b}_1\times 0 + \hat{b}_2\times 1 \\ \bar{X}_\text{werewolf} &= \hat{b}_0 + \hat{b}_2 \\ \hat{b}_2 &= \bar{X}_\text{werewolf}- \hat{b}_0 \\ &= \bar{X}_\text{werewolf}- \bar{X}_\text{human} \end{aligned}` $$ ]] --- class: center # The model <!-- --> --- class: center # The model <!-- --> --- # The parameter values
Human
Zombie
Werewolf
2
10
6
6
8
3
1
5
0
1
7
2
2
6
8
Mean
2.4
7.2
3.8
-- .eq_lrge[.ong[ `\(\hat{b}_0 = \bar{X}_\text{human} = 2.40\)` ]] -- .eq_lrge[.ong[ `\(\hat{b}_1 = \bar{X}_\text{zombie} - \bar{X}_\text{human} = 7.20 - 2.40 = 4.80\)` ]] -- .eq_lrge[.ong[ `\(\hat{b}_2 = \bar{X}_\text{werewolf} - \bar{X}_\text{human} = 3.80 - 2.40 = 1.40\)` ]] --- class: center # The model <br> .eq_lrge[.ong[ $$ `\begin{aligned} \hat{\text{Fear}}_i &= \hat{b}_0 + \hat{b}_1\text{Zombie vs. Human}_i + \hat{b}_2\text{Werewolf vs. Human}_i \end{aligned}` $$ ]] <br> -- .eq_lrge[.ong[ $$ `\begin{aligned} \hat{\text{Fear}}_i &= 2.4 + 4.8\text{Zombie vs. Human}_i + 1.4\text{Werewolf vs. Human}_i \end{aligned}` $$ ]] --- background-image: url("media/halloween_pumpkins_at_night.jpg") background-size: cover # .gry[Overall fit] <br> <br> .center[ <table> <thead> <tr> <th style="text-align:right;"> r.squared </th> <th style="text-align:right;"> adj.r.squared </th> <th style="text-align:right;"> sigma </th> <th style="text-align:right;"> statistic </th> <th style="text-align:right;"> p.value </th> <th style="text-align:right;"> df </th> <th style="text-align:right;"> logLik </th> <th style="text-align:right;"> AIC </th> <th style="text-align:right;"> BIC </th> <th style="text-align:right;"> deviance </th> <th style="text-align:right;"> df.residual </th> <th style="text-align:right;"> nobs </th> </tr> </thead> <tbody> <tr> <td style="text-align:right;background-color: yellow !important;background-color: white !important;"> 0.46 </td> <td style="text-align:right;background-color: yellow !important;background-color: white !important;"> 0.36 </td> <td style="text-align:right;background-color: white !important;"> 2.46 </td> <td style="text-align:right;background-color: yellow !important;background-color: white !important;"> 5.02 </td> <td style="text-align:right;background-color: white !important;"> 0.03 </td> <td style="text-align:right;background-color: yellow !important;background-color: white !important;"> 2 </td> <td style="text-align:right;background-color: white !important;"> -33.13 </td> <td style="text-align:right;background-color: white !important;"> 74.26 </td> <td style="text-align:right;background-color: white !important;"> 77.1 </td> <td style="text-align:right;background-color: white !important;"> 72.8 </td> <td style="text-align:right;background-color: yellow !important;background-color: white !important;"> 12 </td> <td style="text-align:right;background-color: white !important;"> 15 </td> </tr> </tbody> </table> ] <br> -- .infobox[
The type of monster in the prank had a significant effect on fear levels, *F*(2, 12) = 5.02, *p* = 0.026, *R*<sup>2</sup> = 0.46. ] --- background-image: url("media/halloween_lots_of_pumpkins.jpg") background-size: cover # .gry[Parameter estimates] <br> .center[ <table> <thead> <tr> <th style="text-align:left;"> term </th> <th style="text-align:right;"> estimate </th> <th style="text-align:right;"> std.error </th> <th style="text-align:right;"> statistic </th> <th style="text-align:right;"> p.value </th> <th style="text-align:right;"> conf.low </th> <th style="text-align:right;"> conf.high </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;background-color: white !important;"> (Intercept) </td> <td style="text-align:right;background-color: white !important;"> 2.4 </td> <td style="text-align:right;background-color: white !important;"> 1.10 </td> <td style="text-align:right;background-color: white !important;"> 2.18 </td> <td style="text-align:right;background-color: white !important;"> 0.05 </td> <td style="text-align:right;background-color: white !important;"> 0.00 </td> <td style="text-align:right;background-color: white !important;"> 4.80 </td> </tr> <tr> <td style="text-align:left;background-color: white !important;"> entityZombie </td> <td style="text-align:right;background-color: white !important;"> 4.8 </td> <td style="text-align:right;background-color: white !important;"> 1.56 </td> <td style="text-align:right;background-color: white !important;"> 3.08 </td> <td style="text-align:right;background-color: white !important;"> 0.01 </td> <td style="text-align:right;background-color: white !important;"> 1.41 </td> <td style="text-align:right;background-color: white !important;"> 8.19 </td> </tr> <tr> <td style="text-align:left;background-color: white !important;"> entityWerewolf </td> <td style="text-align:right;background-color: white !important;"> 1.4 </td> <td style="text-align:right;background-color: white !important;"> 1.56 </td> <td style="text-align:right;background-color: white !important;"> 0.90 </td> <td style="text-align:right;background-color: white !important;"> 0.39 </td> <td style="text-align:right;background-color: white !important;"> -1.99 </td> <td style="text-align:right;background-color: white !important;"> 4.79 </td> </tr> </tbody> </table> ] --- class: inverse background-image: url("media/halloween_pumpkins_fire.jpg") background-size: cover # Testing assumptions .center[ <!-- --> ] --- background-image: url("media/pumpkin_maths_background.png") background-size: cover # .gry[Robust *F*-statistic] .center[ ```r stats::oneway.test(fear ~ entity, data = humans_tib) ``` ] .center[ .infobox[ ``` ## ## One-way analysis of means (not assuming equal variances) ## ## data: fear and entity ## F = 6.8917, num df = 2.0000, denom df = 7.7365, p-value = 0.01911 ``` ] ] -- <br> .infobox[
The type of monster in the prank had a significant effect on fear levels, *F*(2, 7.74) = 6.89, *p* = 0.019. ] --- background-image: url("media/halloween_trick_or_treat.jpg") background-size: cover # .gry[Robust model using HC4 Standard errors] .center[ ```r parameters::parameters(human_lm, vcov = "HC4") ``` ] .center[ <table> <thead> <tr> <th style="text-align:left;"> Parameter </th> <th style="text-align:right;"> Coefficient </th> <th style="text-align:right;"> SE </th> <th style="text-align:right;"> CI </th> <th style="text-align:right;"> CI_low </th> <th style="text-align:right;"> CI_high </th> <th style="text-align:right;"> t </th> <th style="text-align:right;"> df_error </th> <th style="text-align:right;"> p </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;background-color: white !important;"> (Intercept) </td> <td style="text-align:right;background-color: white !important;"> 2.4 </td> <td style="text-align:right;background-color: white !important;"> 0.927 </td> <td style="text-align:right;background-color: white !important;"> 0.95 </td> <td style="text-align:right;background-color: white !important;"> 0.379 </td> <td style="text-align:right;background-color: white !important;"> 4.421 </td> <td style="text-align:right;background-color: white !important;"> 2.588 </td> <td style="text-align:right;background-color: white !important;"> 12 </td> <td style="text-align:right;background-color: white !important;"> 0.024 </td> </tr> <tr> <td style="text-align:left;background-color: white !important;"> entityZombie </td> <td style="text-align:right;background-color: white !important;"> 4.8 </td> <td style="text-align:right;background-color: white !important;"> 1.265 </td> <td style="text-align:right;background-color: white !important;"> 0.95 </td> <td style="text-align:right;background-color: white !important;"> 2.044 </td> <td style="text-align:right;background-color: white !important;"> 7.556 </td> <td style="text-align:right;background-color: white !important;"> 3.795 </td> <td style="text-align:right;background-color: white !important;"> 12 </td> <td style="text-align:right;background-color: white !important;"> 0.003 </td> </tr> <tr> <td style="text-align:left;background-color: white !important;"> entityWerewolf </td> <td style="text-align:right;background-color: white !important;"> 1.4 </td> <td style="text-align:right;background-color: white !important;"> 1.703 </td> <td style="text-align:right;background-color: white !important;"> 0.95 </td> <td style="text-align:right;background-color: white !important;"> -2.310 </td> <td style="text-align:right;background-color: white !important;"> 5.110 </td> <td style="text-align:right;background-color: white !important;"> 0.822 </td> <td style="text-align:right;background-color: white !important;"> 12 </td> <td style="text-align:right;background-color: white !important;"> 0.427 </td> </tr> </tbody> </table> ] ??? Using a robust model the results don't change. --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/cubit_azal_lecture_end_captioned.mp4" type="video/mp4"> </video> --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/f_song_instrumental.mp4" type="video/mp4"> </video> --- background-image: none background-color: #000000 class: no-scribble <video width="100%" height="100%" controls id="my_video"> <source src="media/f_song.mp4" type="video/mp4"> </video>