x: | 2 | 4 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 |
---|---|---|---|---|---|---|---|---|---|---|
y: | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
Model | Independent Variable | Parameter Estimates |
Standard Error | 95% Confidence Interval |
---|---|---|---|---|
Linear | Intercept | 0.42081 | 0.02494 | (0.36842, 0.47320) |
len | 2.12796 | 0.08195 | (1.95578, 2.30014) | |
Quadratic | Intercept | 0.29426 | 0.01204 | (0.26886, 0.31965) |
len | 3.48676 | 0.10392 | (3.26751, 3.70601) | |
lenlen | -2.54743 | 0.18924 | (-2.94670, -2.14816) | |
Square Root | Intercept | 0.01165 | 0.00621 | (-0.00141, 0.02471) |
sqrtlen | 1.98756 | 0.01203 | (1.96228, 2.01285) | |
Log-Log | Intercept | 0.68005 | 0.00702 | (0.66530, 0.69480) |
loglen | 0.48618 | 0.00402 | (0.47773, 0.49463) |
Dummy Variables for Factor Center | ||||
---|---|---|---|---|
factor levels | A | B | C | D |
A | 1 | 0 | 0 | 0 |
B | 0 | 1 | 0 | 0 |
C | 0 | 0 | 1 | 0 |
D | 0 | 0 | 0 | 1 |
E | 0 | 0 | 0 | 0 |
Pesticide 1 2 3 4 +-------+-------+-------+-------+ 1 | 49 39 | 50 55 | 43 38 | 43 58 | +-------+-------+-------+-------+ Variety 2 | 55 41 | 67 58 | 53 42 | 85 73 | +-------+-------+-------+-------+ 3 | 66 68 | 85 92 | 69 62 | 85 89 | +-------+-------+-------+-------+
model1 <- lm(yield ~ variety, data=orange) model2 <- lm(yield ~ variety + pesticide, data=orange) library(car) anova(model2, model1) # Output: Res.Df RSS Df Sum of Sq F Pr(>F) 1 18 971.92 2 21 2964.38 -3 -1992.5 12.3 0.0001295 ***The F-value for the pesticide-only one-way model is 2.86, which has the p-value 0.0625. This is larger than the p-value from the partial F-test in the previous bullet point. This is because variety effect in the additive model takes away variation due to error and moves it to variation due to the variety effect.
model A B A*B;the SS for A and B will be adjusted for each other, but A*B will be adjusted for neither A nor B. A*B will be adjusted for both A and B.
model A B A*B;the effect A is adjusted for both B and A*B, even though A is contained in A*B.
Variable | Meaning |
---|---|
PRICE100 | Dependent variable. Price ($100) |
FLOOR | Floor height of the unit (1 to 8) |
DIST | Distance (feet) from the elevator |
VIEW | Dummy variable = 1 if unit has an ocean view, 0 otherwise |
END | Dummy variable = 1 if unit is on end of floor with blocked view |
FURNISH | Dummy variable = 1 if unit is furnished |
PRICE100 = FLOOR DIST VIEW END FURNISH
FLOOR*FLOOR DIST*DIST FLOOR*DISTModel 3: Interaction terms with view are added to the floor and distance terms:
FLOOR*VIEW DIST*VIEW FLOOR*FLOOR*VIEW DIST*FLOOR*VIEW DIST*DIST*VIEWModel 4: Same as Model 3, but floor is converted to a factor using 7 dummy variables. (The factor FLOOR has 8 levels.) Use proc glm because setting up interaction terms with dummy variables is much easier than with proc reg.
Model | DFM | SSE | DFE | MSE | R2 |
---|---|---|---|---|---|
1 | 5 | 120802 | 203 | 595.08 | 0.4819 |
2 | 8 | 100163 | 200 | 500.81 | 0.5639 |
3 | 13 | 88827 | 195 | 455.52 | 0.6034 |
4 | 42 | 62150 | 166 | 374.40 | 0.6756 |
Variable | Meaning |
---|---|
LNPRICE | Dependent variable. Log of supply price |
DIST | Miles traveled (100 miles) |
WGT | Weight of product shipped (1000 lbs.) |
PCTLD | Percent of truck load capacity |
ORIG | City of origin (JAX or MIA) |
MARKET | Size of market destination (LARGE or SMALL) |
DEREG | Deregulation in effect (YES or NO) |
PROD | Product classification (100, 150, 200) |
DIST WGT DEREG ORIG
DIST WGT DIST*DIST WGT*WGT DIST*WGT DEREG DIST*DEREG WGT*DEREG DIST*DIST*DEREG WGT*WGT*DEREG DIST*WGT*DEREG ORIG DIST*ORIG WGT*ORIG DIST*DIST*ORIG WGT*WGT*ORIG DIST*WGT*ORIG DEREG*ORIG DIST*DEREG*ORIG WGT*DEREG*ORIG DIST*DIST*DEREG*ORIG WGT*WGT*DEREG*ORIG DIST*WGT*DEREG*ORIGModel2: Same as Model1, except that quadratic terms involving DIST and WGT are dropped, leaving.
DIST WGT DEREG DIST*DEREG WGT*DEREG ORIG DIST*ORIG WGT*ORIG DEREG*ORIG DIST*DEREG*ORIG WGTDEREG*ORIG
DIST WGT DIST*DIST WGT*WGT DIST*WGT DEREG ORIG DEREG*ORIGModel4: Same as Model1, except that the interactions between quadratic terms with DEREG and ORIG are dropped. (Interactions between DEREG, ORIG, and DIST*WGT are kept.) The remaining terms in Model4 are:
DIST WGT DIST*DIST WGT*WGT DIST*WGT DEREG DIST*DEREG WGT*DEREG DIST*DIST*DEREG DIST*WGT*DEREG ORIG DIST*ORIG WGT*ORIG DIST*WGT*ORIG DEREG*ORIG DEREG*ORIG DIST*DEREG*ORIG WGT*DEREG*ORIG DIST*WGT*DEREG*ORIG
BON DUNCAN GABRIEL REGWQ SIDAK SCHEFFE SMM T TUKEYPersonally, I like Duncan's test. However, everything really reduces to whether you prefer a conservative test or liberal test.
"BH" "bonferroni" "BY" "fdr" "hochberg" "holm" "hommel" "none"