turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Converting Zscore to standard deviation

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-23-2018 09:03 AM - edited 05-23-2018 09:16 AM

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
;
```

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Cruise

05-23-2018 09:38 AM

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;
```

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Cruise

05-23-2018 10:29 AM

@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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

05-23-2018 10:47 AM - edited 05-23-2018 10:52 AM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Cruise

05-23-2018 11:25 AM

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).

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to ballardw

05-23-2018 12:19 PM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Cruise

05-24-2018 11:42 AM

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