New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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