Hello! I am trying to perform a right tailed test on a set of data. Its for average gpa of 700 students.
Here is my code:
libname soapy '\\Client\D$\SAS\Data';
data FINAL;
infile '\\Client\D$\SAS\Data\finaldata.txt';
input ID GPA HSRANK ACT YEAR;
run;
proc means data= FINAL n mean stderr alpha=0.02 median p50 clm maxdec=2;
var GPA;
run;
proc univariate data=FINAL alpha=0.02 cibasic mu0=3.03;
var GPA;
run;
I get a confidence interval for the mean which is [2.92, 3.03]. Then I tested for Mu0=3.03 since SAS can't do Mu0>3.03. from the proc univariate command I get the test statistic -2.20461 with an associated p-value 0.0278. (alpha=0.02). These results are for a 2 tailed test with the alternative hypothesis Ha: mean does not equal 3.03. How to get the p-value for Ha: Mu>3.03? Can I get SAS to print it?
Any help would be appreciated! I've attached the text file with the data if it helps...
So you want a 98% 1-sided confidence interval, instead of a 98% 2-sided confidence interval which is what SAS provides by default.
A 98% 1-sided confidence interval has 2% of the distribution in the right tail; a 98% 2-sided confidence interval has 1% of the distribution in the right tail and 1% in the left tail.
So to get 2% in the right tail, you ask SAS for a 96% confidence interval, which produces a test with 2% in the right tail and 2% in the left tail. Then you ignore the left tail, and only use the right tail.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.