BookmarkSubscribeRSS Feed
lshaw753
Calcite | Level 5

Hello! Im very new at learning how to use the SAS program.  Is there anyone that can guide me on how to do these analysis on uploaded data.  Thanks so much!

 

1. Use proc corr to compute the correlation between the dietary supplements DSQTCALC (Calcium) and DSQTPHOS (Phosphorus), both in milligrams. Report the correlation coefficient r and if the association is significant or not (report the p value as well).

2. Run proc means on these two variables, reporting the mean, standard deviation, and number of valid participant observations for each.

3. Perform a t-test between males and females on DSQTCALC. Is there a significant difference between these two groups? If so, which group takes more calcium supplements (report the mean values for these two groups? Report the t statistic, p value, and if there is a significant difference between males and females based upon the p value. Be sure to use the WTMEC2YR for your t-test analysis.

6 REPLIES 6
sbxkoenk
SAS Super FREQ

Hello,

 

It's always wise to specify the SAS version you are using (and possibly the Operating System (OS)).

To find out about your SAS version, submit :

%PUT &=sysvlong4;

to find out about it!

 

I am going to assume you have SAS VIYA 3.5+.

I have :

%PUT &=sysvlong4;
SYSVLONG4=V.03.05M0P11112019

There are "tasks" for all the assignments you need to do. By filling out the task template the code is written for you.

See here :

sbxkoenk_0-1632563494654.png

Good luck,

Koen

lshaw753
Calcite | Level 5

Thanks for the help.  Im using the SAS OnDemand for Academics version.  I put in the first information to find out my system.  This is what I got

lshaw753_1-1632571888372.png

 

 

lshaw753
Calcite | Level 5

Sample dataset Im using is not coming up when I do the correlation analysis

sbxkoenk
SAS Super FREQ

OK.

You are using SAS 9.4 Maintenance Level 6 from autumn 2018 and you use SAS Studio as a front-end.

You need to specify a Library Reference for your dataset to come up.

 

LIBNAME MY_LIB V9 '/sas/demodata/Rest_of_Directory_Path_to_Data' /* access=readonly */;

Change the directory path between the quotes to the directory path your data is in!

Your dataset has a two-level name, being MY_LIB.abcxyz (where abcxyz is the name of your data file).

 

Good luck,

Koen

lshaw753
Calcite | Level 5

Im really getting somewhere with your directions. I think you so much! I working on the following.  I dont know if Im inputting the information in the right  areas. Use proc corr to compute the correlation between the dietary supplements DSQTCALC (Calcium) and DSQTPHOS (Phosphorus), both in milligrams. Report the correlation coefficient r and if the association is significant or not (report the p value as well).

 

lshaw753_1-1632590909845.png

 

lshaw753_2-1632590933908.png

 

lshaw753_3-1632590956212.png

 

sbxkoenk
SAS Super FREQ

Hello,

It's as simple as this (see program below).

I use the dataset sashelp.fish , which is a sample dataset everybody has.

Hence, you can run below code as well.

Look at the output. It will be clear to you!

proc corr data=sashelp.fish PEARSON PLOTS=SCATTER;
 var Weight Height;
run;

Regards,

Koen

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 6 replies
  • 597 views
  • 0 likes
  • 2 in conversation