Normal linear models

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/43

flashcard set

Earn XP

Description and Tags

By the end of these workshops and your own studies, you should be able to · · · · · Formally describe a normal linear model Implement normal models (continuous, categorical predictors) Conceptually understand maximum likelihood estimation (how lm determines model coefficients) Interpret model coefficients and quantities related to null hypothesis testing (confidence interval, t-value, p-value) Predict hypothetical outcomes given a statistical model Using a combination of theoretical descriptions, practical exercises, implementations, and simulations

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

44 Terms

1
New cards

What are normal linear models?

A model of how the probability distribution of one variable, known as the outcome variable, varies as a function of other variables, known as the explanatory or predictor variables

2
New cards

normal linear models are The most basic type of

regression models is the normal linear model.

3
New cards

rnorm generates…

unimodal,  symmetrically distributed values

<p>unimodal,&nbsp; symmetrically distributed values</p>
4
New cards

Normal linear model (formal description)

yi~N(ui,o2)

ui= B0 + B1 ⋅  x1i

<p>yi~<em>N</em>(ui,o2)</p><p>ui= B0 + B1&nbsp;⋅&nbsp; x1i</p>
5
New cards
<p>what does ui represent?</p>

what does ui represent?

is a deterministic (“ = ”) function of one or more predictors and the unknowns (intercept) and   is “constant” (slope).

6
New cards
<p>what does B0 represent?</p>

what does B0 represent?

is the constant

7
New cards
<p>what does B1 represent?</p>

what does B1 represent?

directly depends on explanatory variable x1i

8
New cards
<p>if x1i takes on the value of 0, then ui =…?</p>

if x1i takes on the value of 0, then ui =…?

B0

<p>B0</p>
9
New cards
<p>if x1i takes on the value of 1, then ui =…?</p>

if x1i takes on the value of 1, then ui =…?

B0 + B1

<p>B0 + B1</p>
10
New cards

B1 is  the difference between 

x1i = 1 and x1i= 0

11
New cards

β1​ measures how much the mean changes when you go from x=0 to x=1

For example: if “gender (1 = male, 0 = female)”, then B1 represents the mean difference between males and females

12
New cards

# Decompose the mean

beta_0 = 500

beta_1 = 50

<p>beta_0 = 500 </p><p>beta_1 = 50</p>
13
New cards

Simulation of normal distributed data

1) set parameter values

2)random data for group1

3) random data for group 2

→4) generate data

<p>1) set parameter values</p><p>2)random data for group1</p><p>3) random data for group 2</p><p></p><p>→4) generate data</p><p></p>
14
New cards

Simulation of normal distributed data 2

5)make normal linear model of data

6)then check model coefficients

7)then check standard deviation

<p>5)make normal linear model of data</p><p>6)then check model coefficients</p><p>7)then check standard deviation</p>
15
New cards

To check model coefficients, type the following function

coef(model_name)

16
New cards

To check model standard deviation, type the following function

sigma(model_name)

17
New cards
<p>Write the following&nbsp;Normal linear model (formal description) of how the mean of the distribution of reaction times (rt) varies as a function of age and sex.</p>

Write the following Normal linear model (formal description) of how the mean of the distribution of reaction times (rt) varies as a function of age and sex.

rt i ~ N(ui,o2)

ui = B0 + Bage ⋅ agei + Bsex ⋅sexi

<p>rt i ~ <em>N</em>(ui,o2)</p><p>ui = B0 + Bage ⋅ agei + Bsex ⋅sexi</p>
18
New cards

Real data may appear non-normal distributed for  small samples…

which is fine if we have reasons to believe the data  come from a process that is normal distributed.

19
New cards

Log-normal distributions are zero-bound BECAUSE…

-log normal distributio only takes on POSITIVE values (it’s bounded below by 0)

→For example 

Reaction times can’t be less than 0 seconds, but they can be 0.2 s, 0.5 s

20
New cards

We assume that the rt values are sampled from a log-normal distribution…

This means we think each observed reaction time rti comes from a log-normal population with some:

mean: ui

standard deviation: o

“These describe the distribution of the log of reaction times, not the reaction times themselves.“

<p>This means we think each observed reaction time rti comes from a log-normal population with some:</p><p>mean: ui</p><p>standard deviation: o</p><p></p><p><strong>“These describe the distribution of the log of reaction times, not the reaction times themselves.“</strong></p><p></p>
21
New cards
<p>example of log rt seprated by sex </p>

example of log rt seprated by sex

B0 is the average (logrt) for females becasue…

<p>B0 is the average (logrt) for females becasue…</p>
22
New cards

Compare simulated and real data 3

8)Load and mutate/select real data to compare to logarythmic data created earlier

9)glimpse what it looks like

10) wrtite a linear regression model on the code

11)use the coef funciton to check coefficients

<p>8)Load and mutate/select real data to compare to logarythmic data created earlier</p><p>9)glimpse what it looks like</p><p>10) wrtite a linear regression model on the code</p><p>11)use the coef funciton to check coefficients</p>
23
New cards

When in the lecture it says “Slope coef is not additive (linear) but

multiplicative (exponential scale)“

its means that →…

this parcutilar slope coefficient is on an exponential scale (because its based on logarythmic data), rather than linear scale which is based on normal data

24
New cards

Interpreting coeffcients on the log scale 4

12)do linear regresion model from before

13)make a model out of the coeffiecnts collected from the model made just before

14)convert the coefficients back into the orignial data format whihc in this example is “msecs“(=milliseconds of reaction time)

→this also splits them by sex because female is = 0 and male =1***

<p>12)do linear regresion model from before</p><p>13)make a model out of the coeffiecnts collected from the model made just before</p><p>14)convert the coefficients back into the orignial data format whihc in this example is&nbsp;“msecs“(=milliseconds of reaction time)</p><p></p><p>→this also splits them by sex because female is = 0 and male =1***</p>
25
New cards

What function un-logarythmics coefficients?

Exponentional function

→exp()

26
New cards

Interpreting coeffcients on the log scale 5

15) un-log intercept to show you female’s group reaction time score in milliseconds

16)un-log intercept + slope to show you male’s group reaction time score in milliseconds

17)by taking away male group score from female group score you get=Difference in RT (ms) between male & female

<p>15) un-log intercept to show you female’s group reaction time score in milliseconds</p><p>16)un-log intercept + slope&nbsp;to show you male’s group reaction time score in milliseconds</p><p>17)by taking away male group score from female group score you get=Difference in RT (ms) between male &amp; female</p>
27
New cards

reason why exp(intercept) is female and exp(intercept+slope) is male…

knowt flashcard image
28
New cards

MLEs=

Maximum likelihood estimation

29
New cards
30
New cards
31
New cards
32
New cards
33
New cards
34
New cards
35
New cards
36
New cards
37
New cards
38
New cards
39
New cards
40
New cards
41
New cards
42
New cards
43
New cards
44
New cards