ANOVA 및 REGRESSION에 해당하는 베어링을 가져 오려고이 임시 (진행중인) 시도를 완료하는 데 도움을받을 수 있습니까? 이 두 가지 방법론의 개념, 명명법 및 구문을 조정하려고 노력했습니다. 이 사이트에는 공통점에 대한 많은 게시물이 있습니다 (예 : this 또는 this ). 그러나 시작할 때 빠른 "현재 위치"맵을 유지하는 것이 좋습니다.
이 게시물을 업데이트 할 계획이며 실수를 수정하는 데 도움이되기를 바랍니다.
일원 분산 분석 :
Structure: DV is continuous; IV is ONE FACTOR with different LEVELS.
Scenario: miles-per-gal. vs cylinders
Note that Income vs Gender (M, F) is a t-test.
Syntax: fit <- aov(mpg ~ as.factor(cyl), data = mtcars); summary(fit); TukeyHSD(fit)
Regression: fit <- lm(mpg ~ as.factor(cyl), mtcars)
# with F dummy coded;
summary(fit); anova(fit)
양방향 분산 분석 :
Structure: DV is continuous; IV is > 1 FACTORS with different LEVELS.
Scenario: mpg ~ cylinders & carburators
Syntax: fit <- aov(mpg ~ as.factor(cyl) + as.factor(carb), mtcars);
summary(fit); TukeyHSD(fit)
Regression: fit <- lm(mpg ~ as.factor(cyl) + as.factor(carb), mtcars)
# with F dummy coded;
summary(fit); anova(fit)
양방향 요인 분석 :
Structure: All possible COMBINATIONS of LEVELS are considered.
Scenario: mpg ~ cylinders + carburetors + (4cyl/1,...8cyl/4)
Syntax: fit <- aov(mpg ~ as.factor(cyl) * as.factor(carb), mtcars);
summary(fit); TukeyHSD(fit)
Regression: fit <- lm(mpg ~ as.factor(cyl) * as.factor(carb), mtcars)
# with F dummy coded;
summary(fit); anova(fit)
안 코바 :
Structure: DV continuous ~ Factor and continuous COVARIATE.
Scenario: mpg ~ cylinders + weight
Syntax: fit <- aov(mpg ~ as.factor(cyl) + wt, mtcars); summary(fit)
Regression: fit <- lm(mpg ~ as.factor(cyl) + wt, mtcars)
# with F dummy coded;
summary(fit); anova(fit)
MANOVA :
Structure: > 1 DVs continuous ~ 1 FACTOR ("One-way") or 2 FACTORS ("Two-way MANOVA").
Scenario: mpg and wt ~ cylinders
Syntax: fit <- manova(cbind(mpg,wt) ~ as.factor(cyl), mtcars); summary(fit)
Regression: N/A
만코 바 :
Structure: > 1 DVs continuous ~ 1 FACTOR + 1 continuous (covariate) DV.
Scenario: mpg and wt ~ cyl + displacement (cubic inches)
Syntax: fit <- manova(cbind(mpg,wt) ~ as.factor(cyl) + disp, mtcars); summary(fit)
Regression: N/A
요인 내 (또는 대상) 분산 분석 : ( 여기 코드 )
Structure: DV continuous ~ FACTOR with each level * with subject (repeated observations).
Extension paired t-test. Each subject measured at each level multiple times.
Scenario: Memory rate ~ Emotional value of words for Subjects @ Times
Syntax: fit <- aov(Recall_Rate ~ Emtl_Value * Time + Error(Subject/Time), data);
summary(fit); print(model.tables(fit, "means"), digits=3);
boxplot(Recall_Rate ~ Emtl_Value, data=data)
with(data, interaction.plot(Time, Emtl_Value, Recall_Rate))
with(data, interaction.plot(Subject, Emtl_Value, Recall_Rate))
NOTE: Data should be in the LONG FORMAT (same subject in multiple rows)
Regression: Mixed Effects
require(lme4); require(lmerTest)
fit <- lmer(Recall_Rate ~ Emtl_Value * Time + (1|Subject/Time), data);
anova(fit); summary(fit); coefficients(fit); confint(fit)
or
require(nlme)
fit <- lme(Recall_Rate ~ Emtl_Value * Time, random = ~1|Subject/Time, data)
summary(fit); anova(fit); coefficients(fit); confint(fit)
스플릿 플롯 : ( 여기 코드 )
Structure: DV continuous ~ FACTOR/-S with RANDOM EFFECTS and pseudoreplication.
Scenario: Harvest yield ~ Factors = Irrigation / Density of seeds / Fertilizer
& RANDOM EFFECTS (Blocks and plots of land):
Syntax: fit <- aov(yield ~ irrigation * density * fertilizer +
Error(block/irrigation/density), data); summary(fit)
Regression: Mixed Effects
require(lme4); require(lmerTest);
fit <- lmer(yield ~ irrigation * fertilizer +
(1|block/irrigation/density), data = splityield);
anova(fit); summary(fit); coefficients(fit); confint(fit)
or
library(nlme)
fit <- lme(yield ~ irrigation * variety, random=~1|field, irrigation)
summary(fit); anova(fit)
필요한 디자인 : ( 여기 코드 )
Structure: DV continuous ~ FACTOR/-S with pseudoreplication.
Scenario: [Glycogen] ~ Factors = Treatment & RANDOM EFFECTS with Russian-doll effect:
Six rats (6 Livers)-> 3 Microscopic Slides/Liver-> 2 Readings/Slide).
Syntax: fit <- aov(Glycogen ~ Treatment + Error(Rat/Liver), data); summary(fit)
Regression: Mixed Effects
require(lme4); require(lmerTest)
fit <- lmer(Glycogen ~ Treatment + (1|Rat/Liver), rats);
anova(fit); summary(fit); coefficients(fit); confint(fit)
or
require(nlme)
fit<-lme(Glycogen ~ Treatment, random=~1|Rat/Liver, rats)
summary(fit); anova(fit); VarCorr(fit)
유용한 사이트 :
cyl + hp
입니다. Horespower는 지속적이므로 작동하지 않습니다.carb
기화기의 수가 더 나은 선택이 될 것입니다.