Testing Assumption and Log Transformation

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:13 PM on 10/2/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

26 Terms

1
New cards

Testing Assumptions

checks whether data meet the conditions required for a statistical or regression method. Common assumptions include normality, independence, homoscedasticity, linearity, and absence of severe multicollinearity.

2
New cards

Independence

observations/residuals are not systematically dependent on one another

3
New cards

Homoscedasticity

·       residuals have approximately constant variance.

4
New cards

Linearity

·       the relationship between predictors and the outcome is approximately linear.

5
New cards

No severe multicollinearity

·       independent variables are not excessively correlated with each other.

6
New cards

Fail to reject H

p-value > 0.05

7
New cards

Reject H

p-value ≤ 0.05

8
New cards

Normality

shapiro.test(residuals(model))


Hypotheses:

·       H₀: Residuals are normally distributed.

·       H₁: Residuals are not normally distributed.

Interpretation:

·       p > 0.05 → no significant evidence of non-normality.

·       p ≤ 0.05 → evidence of non-normality.

Visual checks:

qqnorm(residuals(model))
qqline(residuals(model))
hist(residuals(model))


9
New cards

Linearity

plot(x,y)

plot(model)

10
New cards

Homoscedasticity

library(lmtest)

bptest(model)


Hypotheses

H₀: The variance is constant (homoscedasticity).

H₁: The variance is not constant (heteroscedasticity).


Decision rule

At α = 0.05:

p > 0.05

→ Fail to reject H₀
→ No significant evidence of heteroscedasticity.

p < 0.05

→ Reject H₀
→ Evidence of heteroscedasticity.


If the residuals form a funnel:

.

. .

. .

.

.

the variance is changing → possible heteroscedasticity.

11
New cards

Independence/autocorrelation

library(lmtest)
dwtest(model)

Durbin-Watson test:

·       H₀: No autocorrelation.

·       H₁: Autocorrelation exists.

·       p > 0.05 → no significant evidence of autocorrelation.

·       p ≤ 0.05 → evidence of autocorrelation.

12
New cards

Multicollinearity

install.packages('car')
library(car)
vif(model)

Common rules of thumb:

·       VIF ≈ 1 → little multicollinearity.

·       VIF 1–5 → often considered acceptable.

·       VIF > 5 → possible concern.

·       VIF > 10 → commonly treated as serious concern.

13
New cards

Residuals

 = Actual value − Predicted value


residuals(model)
model$residuals

14
New cards

Basic regression

Simple:

lm(Y ~ X, data = data)


Multiple:

lm(Y ~ X1 + X2 + X3, data = data)

15
New cards

4 main diagnostic plots

Residuals vs fitted

Normal-qq

Scale-location

Residuals vs leverage

16
New cards

Residuals vs fitted

mainly checks linearity and constant variance.

17
New cards

Normal-qq

checks whether residuals approximately follow a normal distribution

18
New cards

Scale-location

helps assess whether residual spread is roughly constant.

19
New cards

Residuals vs leverage

·       helps identify observations that may be influential.

20
New cards

Log Transformation

converts a positive variable into its logarithm, commonly the natural logarithm (ln). It is often used with skewed economic data, large ranges, nonlinear relationships, or changing variance.


log(dataincome)</span></p><p><span>dataincome)</span></p><p><span>datalog_income <- log(data$income)


·       Reduce right skewness.

·       Compress very large values and reduce the influence of extreme scale differences.

·       Sometimes improve linearity.

·       Sometimes reduce heteroscedasticity.

·       Allow useful percentage and elasticity interpretations in economic models.

21
New cards

Level - Level

Y ~ X

1-unit increase in X → β-unit change in Y


22
New cards

Log level

log(Y) ~ X

1-unit increase in X → approximately 100β% change in Y


23
New cards

Level log

Y ~ log(X)

1% increase in X → approximately β/100-unit change in Y


24
New cards

Log log

log(Y) ~ log(X)

1% increase in X → approximately β% change in Y


25
New cards

Log log model

model_log <- lm(log(x) ~ log(y), data = data)

In a log-log model, the slope coefficient is interpreted as an elasticity.

26
New cards

Log transformation and assumption testing

If an original model shows a possible problem such as heteroscedasticity, a researcher may consider a theoretically appropriate transformation and then re-check the model.

model_log <- lm(log(x) ~ log(y), data = data)
bptest(model_log)
shapiro.test(residuals(model_log))
plot(model_log)