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.