I need to get the mean score for an implicit bias test from each group within the demographic categories I am using (i.e Age, Gender, Race) and get the p-value per my committee chair. He is not used to SAS so is unable to assist me, but he advised me to search if I can get a t-test and ANOVA using proc means for categories that have two groups and ones that have more than two groups respectively.
I found out how to run a paired t test using proc means (please let me know if I did this incorrectly):
proc means data=IAT2018 N MEAN T PRT;
class birthsex;
var D_biep_White_Good_all;
run;
Is there a possible way to run an ANOVA test using PROC MEANS as well? My committee chair really wants me to do this, but I am at a loss. Also, I am unable to upload the data since it is 1.3 GB so I apologize for any inconvenience. Please let me know if you require further information.
@tainaj wrote:
An example of what I actually want to test for is to see if there is a difference in mean IAT score between each race. The null hypothesis: there is no difference in mean IAT score between each race. Alternative hypothesis: at least one of the races has a different mean IAT score. I would like to do this for each demographic category (Gender, race, education level, political affiliation, occupation). Please let me know if I need to add further information or need to clarify something? Also, please let me know if there is anything wrong with what I am trying to test.
This can be done in PROC ANOVA or PROC GLM. Example: https://documentation.sas.com/doc/en/pgmmvacdc/9.4/statug/statug_anova_gettingstarted01.htm
PROC MEANS cannot run a t-test, what it's doing there is checking if the mean is 0, not testing if they're equivalent between the classes. That's why you have two test statistics (t-value) that differ instead of a single value for the test.
PROC MEANS cannot do the ANOVA/TTEST but PROC ANOVA/TTEST can, is there a reason you can't use them?
Here's an older proc anova tutorial but the free SAS Stats course will cover these topics as well.
https://www.stattutorials.com/SAS/TUTORIAL-PROC-GLM.htm
@tainaj wrote:
I need to get the mean score for an implicit bias test from each group within the demographic categories I am using (i.e Age, Gender, Race) and get the p-value per my committee chair. He is not used to SAS so is unable to assist me, but he advised me to search if I can get a t-test and ANOVA using proc means for categories that have two groups and ones that have more than two groups respectively.
I found out how to run a paired t test using proc means (please let me know if I did this incorrectly):
proc means data=IAT2018 N MEAN T PRT;
class birthsex;
var D_biep_White_Good_all;
run;
Is there a possible way to run an ANOVA test using PROC MEANS as well? My committee chair really wants me to do this, but I am at a loss. Also, I am unable to upload the data since it is 1.3 GB so I apologize for any inconvenience. Please let me know if you require further information.
This is what I wanted to run initially, but my committee chair stated that I need to run a test between each group in each category. For example, get the p-value for the mean IAT score and the different age groups (16-19, 20-29, 30-39, 40-49, 50-64, and 65+). For context, I used proc means in order to get the mean IAT scores in the table below; the data does IAT score does not show up as mean values of course. Unfortunately, he is asking me to do this but is unable to show me any sort of example of how to achieve what he is asking for since he uses a different software.
@tainaj wrote:
Since you are saying this is impossible, do you think simply running PROC ANOVA and PROC TTEST would provide the result as you stated? Also, please let me know if you require information or more details on what my committee chair is asking me to do!
This is impossible to do with PROC MEANS.
Yes, running ANOVA/TTEST will provide the results you want. Did you read through the tutorials I linked to?
For example, get the p-value for the mean IAT score
P-values don't exist as an independent entity. P-values only exist for testing a specific hypothesis, which you haven't been clear about. What hypothesis do you want p-values for? Please be specific.
Agreeing with @Reeza , PROC GLM or PROC TTEST or similar is the way to go here. PROC MEANS is a waste of time, as explained above that PROC MEANS only tests the hypothesis that the mean is equal to zero.
By the way, the table you present does not do any hypothesis testing, and so is relatively meaningless in the context of your question.
@tainaj wrote:
An example of what I actually want to test for is to see if there is a difference in mean IAT score between each race. The null hypothesis: there is no difference in mean IAT score between each race. Alternative hypothesis: at least one of the races has a different mean IAT score. I would like to do this for each demographic category (Gender, race, education level, political affiliation, occupation). Please let me know if I need to add further information or need to clarify something? Also, please let me know if there is anything wrong with what I am trying to test.
This can be done in PROC ANOVA or PROC GLM. Example: https://documentation.sas.com/doc/en/pgmmvacdc/9.4/statug/statug_anova_gettingstarted01.htm
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.