BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SIgnificatif
Quartz | Level 8

Hi Dear All, 

I have the following test data :

data test;
input id type $ String $;

datalines;
1 property level1
2 property level2
3 property level3
4 property level1
5 property level2
6 car level3
7 car level1
8 car level4
9 car level3
;
run;

data test2;
input id type $ String $;

datalines;
1 property level3
2 property level3
3 property level5
4 property level5
5 property level1
6 car level1
7 car level6
8 car level8
9 car level8
;
run;


How to perform the chi-square test on test and test2 by id, considering the 'graduality' of the level, to know if the level increased or decreased? and based on the type ( property or car) ...? there are maximum level8 ( from level1-level8)
more precisely :

  • if the level increased in test2
  • if the level decreased in test2
  • if the level remained the same

I know the data shown here is not enough, but it's to simplify...


Thank you for response.

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Yes I mean a new numeric variable with the level numbers only, and not the letters LEVEL.

 

I'm not sure what your objection is to creating a new variable, it seems like a trivially simple thing to do, and it seems to me like that's the only way to get an answer to your question.

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Can't you simply put the actual number of 2 in place of "LEVEL2" for example, and then analyze it with the numbers?

 

If that's not what you want, then you need to explain more what the answer is that you are looking for.

--
Paige Miller
SIgnificatif
Quartz | Level 8

Hi, thank you for the response Dear Paige.

Yes, I can put the number 2, 
do you mean, the idea is creating new vars and comparing them?
I was thinking to work with the same variables without creating new ones, but if there is no other way...

Sincerely,

PaigeMiller
Diamond | Level 26

Yes I mean a new numeric variable with the level numbers only, and not the letters LEVEL.

 

I'm not sure what your objection is to creating a new variable, it seems like a trivially simple thing to do, and it seems to me like that's the only way to get an answer to your question.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 669 views
  • 0 likes
  • 2 in conversation