A00-240 · Question #24
The SAS data set RESULT contains the following variables: Region (GrpA or GrpB) Sales (dollars per year) Which SAS programs can be used to find the p-value for comparing GrpA sales with GrpB sales? (C
The correct answer is A. proc ttest data = RESULT; class Region; var Sales; run;. Option A is correct because PROC TTEST requires a CLASS statement (to define the two groups) and a VAR statement (to specify the continuous response variable) - this is the exact valid syntax for a two-sample t-test comparing GrpA vs. GrpB sales. Option C is also correct (the ans
Question
- Region (GrpA or GrpB)
- Sales (dollars per year) Which SAS programs can be used to find the p-value for comparing GrpA sales with GrpB sales? (Choose two.)
Options
- Aproc ttest data = RESULT; class Region; var Sales; run;
- Bproc ttest data = RESULT; class Region; model Sales = Region; run;
- Cproc glm data = RESULT; class Region; model Sales = Region; run;
- Dproc glm data = RESULT; class Sales; model Sales = Region; run;
How the community answered
(24 responses)- A71% (17)
- B8% (2)
- C17% (4)
- D4% (1)
Explanation
Option A is correct because PROC TTEST requires a CLASS statement (to define the two groups) and a VAR statement (to specify the continuous response variable) - this is the exact valid syntax for a two-sample t-test comparing GrpA vs. GrpB sales.
Option C is also correct (the answer key likely intends A and C for "choose two"): PROC GLM uses CLASS for the grouping variable and MODEL dependent = predictor syntax, which is valid and produces an equivalent F-test p-value for a two-group comparison.
Option B is wrong because PROC TTEST does not accept a MODEL statement - that syntax belongs to PROC GLM/PROC REG; using it in PROC TTEST causes an error.
Option D is wrong because CLASS in PROC GLM must identify the categorical grouping variable (Region), not the continuous response variable (Sales) - putting Sales in CLASS while also using it as the dependent variable in MODEL is logically contradictory.
Memory tip: Think "T-test = VAR" (TTEST gets a VAR statement, not a MODEL), and "GLM = MODEL Y = X" (GLM always uses model notation with the response on the left). Any option that mixes these conventions is wrong.
Topics
Community Discussion
No community discussion yet for this question.