The Cultivar variable is not recognized as categorical for the ANOVA. Any suggestions/recommendations on correcting this issue and anything else you might notice? Thanks!
data rice_yield;
input Soil $ Cultivar $ Yield;
datalines;
Soil_I Cultivar_1 100
Soil_I Cultivar_2 73
Soil_I Cultivar_3 89
Soil_I Cultivar_4 37
Soil_I Cultivar_5 120
Soil_II Cultivar_1 105
Soil_II Cultivar_2 59
Soil_II Cultivar_3 91
Soil_II Cultivar_4 41
Soil_II Cultivar_5 115
Soil_III Cultivar_1 93
Soil_III Cultivar_2 65
Soil_III Cultivar_3 79
Soil_III Cultivar_4 43
Soil_III Cultivar_5 105
;
run;
/* Perform two-way ANOVA with interaction */
proc anova data=rice_yield;
class Soil Cultivar; /* Declare categorical variables */
model Yield = Soil|Cultivar; /* Include interaction term */
means Soil Cultivar / tukey; /* Post-hoc comparisons */
run;
That is because the data you imported in is NOT right.
Change your data step code to import it correctly .
data rice_yield;
input Soil $ Cultivar :$32. Yield;
datalines;
...............
How does the ":$32" change the inputs?
Thanks you so much for the explanation!!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.