linear model Flashcards

(10 cards)

1
Q

How can a t-test be expressed as a linear model?

A

Example: lm(vitd ~ TEON, data=meddata)

Interpretation:

Intercept = mean of baseline group (TEON=”No”).

TEONYes coefficient = difference from baseline.

Matches t-test: Same p-value, CI, and estimates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s the difference between a pooled t-test and a Welch t-test in linear models?

A

Linear model assumes equal variances (like pooled t-test).

Cannot directly model unequal variances (Welch) in basic lm().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is one-way ANOVA performed using lm()?

A

Code: lm(vitd ~ ageTEON, data=meddata) (where ageTEON has 4 levels).

Output:

Intercept = mean of baseline group (e.g., NoOld).

Other coefficients = differences from baseline.

ANOVA table: anova(model) gives F-test for group differences.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you interpret the folate coefficient in lm(vitd ~ folate)?

A

Estimate: 0.0902 → Each 1-unit folate increase predicts 0.0902 higher vitamin D.

Non-significant: p = 0.45 → No evidence of linear relationship.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does R-squared measure in regression?

A

Proportion of variance in vitd explained by predictors.
Example: R² = 0.009 → Folate explains 0.9% of vitamin D variation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Write the matrix form of the linear model.

A

Y=Xβ+ϵ
Y: Response vector.

X: Design matrix (1s in column 1 for intercept).

β: Coefficient vector.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How are fitted values calculated using matrices?

A

Y^=Xβ^

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s the difference between Type I and Type II SS in ANOVA?

A

Type I: Sequential (order matters).

Type II: Tests each predictor after accounting for others.

R Code: car::Anova(model, type=”II”).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you check linear model assumptions?

A

Use plot(model):

Residuals vs. Fitted: Check linearity.

Q-Q Plot: Check normality.

Scale-Location: Check homoscedasticity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is the intercept sometimes meaningless?

A

It’s the predicted Y when all X=0. If X=0 is unrealistic (e.g., folate=0), interpret slope only.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly