BookmarkSubscribeRSS Feed
evat
Calcite | Level 5

Hi Everyone,

 

I'm having some trouble with my code below. I want to test whether or not the mean NPS score of each profession category is statistically different from the population NPS mean (7.57). When looking at the output, I can tell that it's not actually applying the weight (professionweight). 

 

PROC SORT data=name; by professioncategory; RUN;

 

PROC TTEST data=name H0=7.57;
weight professionweight;
var NPS;
by professioncategory;
RUN;

 

Some additional information that might be useful:

The NPS variable has a range of 0 to 10

professioncategory is a categorical variable

 

Is there additional code I need to include in order to ensure the professweight is utilized?

 

Thanks in advance for your help!!

 

Eva

1 REPLY 1
ballardw
Super User

If your weight variable is actually a count of individuals with a common NPS score then you likely need to use it as a FREQ and not weight variable.

 

Otherwise you may have to provide additional information of how you know it is not applied, possibly including actual data for at least one or two of the professioncategory values.

Observations with Weight values of 0, negative or missing will be completely excluded from the calculations.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1 reply
  • 567 views
  • 0 likes
  • 2 in conversation