DATA Step, Macro, Functions and more

Converting Zscore to standard deviation

Reply
Super Contributor
Posts: 337

Converting Zscore to standard deviation

[ Edited ]

I have a zscore (BMI-for-age Z-score) variable. I'd like to convert it to standard deviation. Using below approach, am I converting Zscore to STD correctly here? I will use resulting STD to define overweight where STD>2 and obesity where STD >3.

 

proc standard  mean=0 std=1 data=x out=temp;
var zcore;
run;

/*and merge the output data back to original data.*/ 

 

 

data x;
input zscore;
cards;
-0.13
1
-0.41
2.2
0.84
-0.06
0.19
;

 

SAS Super FREQ
Posts: 4,176

Re: Converting Zscore to standard deviation

To clarify your question, is the data after the PROC STANDARD call the RESULT of the call? I am confused because you are calling the data set 'x', which is the name of the input data set.

 

In the following program, the input data is the variable x in the data set Have.

The call to PROC STANDARD creates a new variable (x - mean(x)) / std(x) in the Temp data set.

The data sets are then merged.

data Have;
input x @@;
cards;
-13 10 -4.1 22 8.4 -0.6 1.9
;

proc means data=Have;
var x;
run;

proc standard  mean=0 std=1 data=Have out=temp;
var x;
run;

/*and merge the output data back to original data.*/ 
data Want;
merge Have Temp(rename=(x=XStd));
run;

proc print data=Want; run;

 

Super User
Posts: 13,358

Re: Converting Zscore to standard deviation


@Cruise wrote:

I have a zscore (BMI-for-age Z-score) variable. I'd like to convert it to standard deviation. Using below approach, am I converting Zscore to STD correctly here? I will use resulting STD to define overweight where STD>2 and obesity where STD >3.

 

proc standard  mean=0 std=1 data=x out=temp;
var zcore;
run;

/*and merge the output data back to original data.*/ 

 

 

data x;
input zscore;
cards;
-0.13
1
-0.41
2.2
0.84
-0.06
0.19
;

 


If this is being used with children's data your approach will not match the CDC guidelines for overweight or obesity which uses percentiles from some standardized by age and gender data, 85th and 95th percentiles being some key points.

 

You probably need to look closer at https://www.cdc.gov/nccdphp/dnpao/growthcharts/resources/sas.htm

which has programs, data sets, instructions for calculating child obesity and some documentation as to why the cut-offs were set. The programs result in direct percentiles of height/weight by age.

Super Contributor
Posts: 337

Re: Converting Zscore to standard deviation

[ Edited ]

@ballardw

Thanks. The goal of this exercise is to define overweight and obesity by both CDC and WHO for comparison. I used resources from their websites. Obesity and overweight using CDC guidelines were defined and plotted. Now I'm dealing with WHO resource where final data with Z-score for BMI-for-age is just created using their macro. I figured WHO recommends using Z-score not standard deviation of it. Overweight defined by CDC is ~15% vs 13.5% by WHO. However, I'm now puzzled with obesity prevalence produced from my data following WHO guideline is being as low as 4.19 defined as >3SD (z-score) vs obesity prevalence defined by CDC's BMI percentile >95pctl was in the range of 15-17%.  Nice chatting with you ballardw. Sound like you have a experience on the subject matter. Any other advice is welcome.  By the way, I created standard deviations of zscore and bmi as well just for curiosity. Resulting numbers didn't make sense.

Super User
Posts: 13,358

Re: Converting Zscore to standard deviation

Yes I work with this also had to explain to some data partners why some prevalence changes were partially caused by CDC changing to the WHO definitions of obesity for children under 2 years of age.

 

 You might get some odd prevalence rates if you are working from "real" data and have not filtered, or at least flagged for consideration, what CDC refers to a "biologically improbable values". I know that if I accepted the as entered from one of my sources blindly we have nearly 25 percent of the children exceeding the 95th percentile with an additional 15 percent below the 5th percentile. Closer look at the data actually shows: values recorded in pounds are kg or vice versa, similar height/length measurements type error, weight transposed with height/length, date of birth and/or date of measurement likely incorrect (third measure for a child now having a DOB 10 months after the previous measurement), people entering numeric values such as 999 or 9999 when not actually measured (not a rule implemented in collection process), and even the DOB and date of measurement transposed (measured before birth).

Super Contributor
Posts: 337

Re: Converting Zscore to standard deviation

@ballardw

My data is clean enough thanks to IT department. By the way, do you know how to calculate 120% of 95th percentile of BMI? Any tutorials? I'm trying to define extreme obesity since multiple literature suggested 120% of 95th percentile of BMI is better than 99th percentile of BMI-for-age-percentile.

Super User
Posts: 13,358

Re: Converting Zscore to standard deviation

If you have the 95th percentile value I would expect that you are looking for 1.2 * 95thPercentile.

If you don't have the 95th percentile but the data is normally distributed and you know the mean and standard deviation:

q = quantile('normal',.95,mean,std);

 

You might get negative values depending on your parameters with the small percentiles like 0.01 from the CDC data for some age/gender combinations

Ask a Question
Discussion stats
  • 6 replies
  • 100 views
  • 0 likes
  • 3 in conversation