Dear SAS Community,
I am using a polynomial regression since the relationship between the outcome var DTR (continuous) and Harvest month (categorical) appears to be curvilinear. I would like to predict DTR (days to ripe) when the fruits were harvested in Jan (1) and Feb (2). Since I am not sure if my estimates are correct, I would greatly appreciate your feedback. I have seven harvest months in total (1,2,3,4,5,6,8).
ods graphics on;
proc glm data=one;
Where Wks<6;
class Harvest;
model DTR= Harvest Harvest*Harvest/solution alpha=.05 clparm;
estimate "pred DTR when Harvest=1" intercept 1 Harvest 1 0 0 0 0 0 0;
estimate "pred DTR when Harvest=2" intercept 1 Harvest 0 1 0 0 0 0 0;
run;
ods graphics off;
Source | DF | Sum of Squares | Mean Square | F Value | Pr > F |
---|---|---|---|---|---|
Model | 6 | 2061.513304 | 343.585551 | 47.34 | <.0001 |
Error | 554 | 4020.971545 | 7.258071 | ||
Corrected Total | 560 | 6082.484848 |
R-Square | Coeff Var | Root MSE | DTR Mean |
---|---|---|---|
0.338926 | 35.00184 | 2.694081 | 7.696970 |
Source | DF | Type I SS | Mean Square | F Value | Pr > F |
---|---|---|---|---|---|
Harvest | 6 | 2061.513304 | 343.585551 | 47.34 | <.0001 |
Source | DF | Type III SS | Mean Square | F Value | Pr > F |
---|---|---|---|---|---|
Harvest | 6 | 2061.513304 | 343.585551 | 47.34 | <.0001 |
Parameter | Estimate | Standard Error |
t Value | Pr > |t| | 95% Confidence Limits | |
---|---|---|---|---|---|---|
pred DTR when Harvest=1 | 10.8666667 | 0.24593480 | 44.19 | <.0001 | 10.3835879 | 11.3497454 |
pred DTR when Harvest=2 | 8.8292683 | 0.42074473 | 20.98 | <.0001 | 8.0028182 | 9.6557184 |
Parameter | Estimate | Standard Error |
t Value | Pr > |t| | 95% Confidence Limits | ||
---|---|---|---|---|---|---|---|
Intercept | 7.625000000 | B | 0.24593480 | 31.00 | <.0001 | 7.141921263 | 8.108078737 |
Harvest 1 | 3.241666667 | B | 0.34780434 | 9.32 | <.0001 | 2.558490165 | 3.924843169 |
Harvest 2 | 1.204268293 | B | 0.48735004 | 2.47 | 0.0138 | 0.246988411 | 2.161548175 |
Harvest 3 | -0.075000000 | B | 0.49186961 | -0.15 | 0.8789 | -1.041157474 | 0.891157474 |
Harvest 4 | -1.200000000 | B | 0.38885707 | -3.09 | 0.0021 | -1.963814549 | -0.436185451 |
Harvest 5 | -0.725000000 | B | 0.49186961 | -1.47 | 0.1411 | -1.691157474 | 0.241157474 |
Harvest 6 | -2.250000000 | B | 0.34780434 | -6.47 | <.0001 | -2.933176502 | -1.566823498 |
Harvest 8 | 0.000000000 | B | . | . | . | . | . |
Note: | The X'X matrix has been found to be singular, and a generalized inverse was used to solve the normal equations. Terms whose estimates are followed by the letter 'B' are not uniquely estimable. |
Thank you very much!
Ok thank you, good to know.
So is this model appropriate for the categorical predictor Harvest (7 levels) and the continuous var DTR?
proc glm data=one order=freq ;
Where Wks<6;
class Harvest;
model DTR=Harvest /solution ss3 alpha=.05 clparm;
estimate "pred DTR when Harvest=1" intercept 1 Harvest 1 0 0 0 0 0 0;
estimate "pred DTR when Harvest=2" intercept 1 Harvest 0 1 0 0 0 0 0;
run;
quit;
Source | DF | Sum of Squares | Mean Square | F Value | Pr > F |
---|---|---|---|---|---|
Model | 6 | 2061.513304 | 343.585551 | 47.34 | <.0001 |
Error | 554 | 4020.971545 | 7.258071 | ||
Corrected Total | 560 | 6082.484848 |
R-Square | Coeff Var | Root MSE | DTR Mean |
---|---|---|---|
0.338926 | 35.00184 | 2.694081 | 7.696970 |
Source | DF | Type III SS | Mean Square | F Value | Pr > F |
---|---|---|---|---|---|
Harvest | 6 | 2061.513304 | 343.585551 | 47.34 | <.0001 |
Parameter | Estimate | Standard Error |
t Value | Pr > |t| | 95% Confidence Limits | |
---|---|---|---|---|---|---|
pred DTR when Harvest=1 | 10.8666667 | 0.24593480 | 44.19 | <.0001 | 10.3835879 | 11.3497454 |
pred DTR when Harvest=2 | 5.3750000 | 0.24593480 | 21.86 | <.0001 | 4.8919213 | 5.8580787 |
Parameter | Estimate | Standard Error |
t Value | Pr > |t| | 95% Confidence Limits | ||
---|---|---|---|---|---|---|---|
Intercept | 6.900000000 | B | 0.42597158 | 16.20 | <.0001 | 6.063283083 | 7.736716917 |
Harvest 1 | 3.966666667 | B | 0.49186961 | 8.06 | <.0001 | 3.000509192 | 4.932824141 |
Harvest 6 | -1.525000000 | B | 0.49186961 | -3.10 | 0.0020 | -2.491157474 | -0.558842526 |
Harvest 8 | 0.725000000 | B | 0.49186961 | 1.47 | 0.1411 | -0.241157474 | 1.691157474 |
Harvest 4 | -0.475000000 | B | 0.52170650 | -0.91 | 0.3630 | -1.499764753 | 0.549764753 |
Harvest 2 | 1.929268293 | B | 0.59873025 | 3.22 | 0.0013 | 0.753209236 | 3.105327350 |
Harvest 3 | 0.650000000 | B | 0.60241478 | 1.08 | 0.2811 | -0.533296412 | 1.833296412 |
Harvest 5 | 0.000000000 | B | . | . | . | . | . |
Great, thank you so much Ksharp!!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.