BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello All,

I have two datasets: one & two. I want to test if there is a difference in the mean score (variable 'SCORE') of two persons in these two datasets. The variable PERSON has two persons (A & B) in it in both datasets.

Could anyone please suggest me a code to deal with two datasets in PROC t test ?

Kindest Regards,
Kriti
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12
you need to provide more detail. We need some sample data and a more precise statement of how the variables relate to each other and to PERSON.

In general, you need to combine the two datasets into one. You can do that with the DATA step. If the two datasets represent pairings, then the MERGE statement would be needed; otherwise SET. In SQL, the comparable clauses are JOIN and UNION.

If your two scores are paired, then you need to take the difference and compare that to 0 using PROC MEANS. If they are independent, you would use the TTEST procedure with some classification variable.

The BY statement takes care of the person variable.

Doc Muhlbaier
Duke

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1115 views
  • 0 likes
  • 2 in conversation