BookmarkSubscribeRSS Feed
michaelm90
Fluorite | Level 6

Hello, I was given this question:  

 

(dataset: SASHELP.BWEIGHT) Create a dataset including first 2,000 observations only in SASHELP.BWEIGHT and report the p-value of testing if two variables MomSmoke and VISIT are independent. Note that you should determine if Chi-sq test is valid or not. Up to four decimal places, please. (Hint: use PROC FREQ) 

 

I understand how to calculate the p-value if the two variables are independent, I am just confused on making a new dataset including the first 2,000 observations of sashelp.bweight. 

1 REPLY 1
Reeza
Super User
data want;
set have (obs=2000);

Use the OBS= Dataset option.

 

https://documentation.sas.com/?docsetId=ledsoptsref&docsetTarget=p0h5nwbig8mobbn1u0dwtdo0c0a0.htm&do...

 

The first SAS e-course is free and covers a lot of the questions you've been asking. It may be worth taking sometime to go over the course materials.

 


@michaelm90 wrote:

Hello, I was given this question:  

 

(dataset: SASHELP.BWEIGHT) Create a dataset including first 2,000 observations only in SASHELP.BWEIGHT and report the p-value of testing if two variables MomSmoke and VISIT are independent. Note that you should determine if Chi-sq test is valid or not. Up to four decimal places, please. (Hint: use PROC FREQ) 

 

I understand how to calculate the p-value if the two variables are independent, I am just confused on making a new dataset including the first 2,000 observations of sashelp.bweight. 


 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 555 views
  • 1 like
  • 2 in conversation