BookmarkSubscribeRSS Feed
LanMin
Fluorite | Level 6

Hi,

  1. I have a panel dataset (below is a small sample). I would like to sort the data independently by Uvalue, and Svalue into quartiles,

By independently, I mean if I use proc rank to output 4 ranks based on Uvalue, I do not consider Svalue. And vice versus if I output based on Svalue.

After the two sorts are done,

I expect 4 ranks within each variable category. 4*4 =16 cells,

My goal is to test whether Dvalue differs significantly within each cell.


2. That is does Dvalue in (Quartile 1 based on Uvalue rank) is significantly different from Dvalue in Quartile 1 based on Dvalue rank.

I know how to single sort, but need your help with double sort, and save the output for T-test in part 2.

thanks!

Lan

firmidyearUvalueSvalueDvalue
100119920.310100
100119930.61190
1001199411190
100119950.912100
100119961.112110
100119970.9212110
100119981.113111
100219930.2920
100219940.3922
100219950.49.123
100219960.91025
100219970.71030
100319951615
100319961.1515
100319971.4716
1 REPLY 1
PGStats
Opal | Level 21

Proc RANK does its own sorting for each variable. You don't have to worry about it. So the answer to your first question is straightforward. The second question however isn't valid statistically as the two sets that you want to compare are not independent. I would simply look at the frequency and Dvalue mean for each combination of quartiles :

proc rank data=have out=haveQuart groups=4;
var Uvalue Svalue;
ranks Uquart Squart;
run;

proc means data=haveQuart n mean nonobs printaltypes;
class Uquart Squart;
var Dvalue;
run;

PG

PG

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2844 views
  • 1 like
  • 2 in conversation