*! Verions 1 31jul2018
help stndzxage

Title

stndzxage -- STaNDardiZe byX AGE

This command standardizes test scores with respect to the mean across age (a running variable)
assuming normal distributions given age. Additional variables can be specified
over which the test variable is age-standardized. For example, a test score could be
standardized over age and sex. Additionally, a subpopulation can serve as a reference population
for standardizing the scores of other observations in the same dataset. The program creates a
new z-score variable, stx_testvar.

Syntax

stndzxage
testvar agevar [varlist] [if]
[, options]

testvar is the variable (test score) to be standardized

agevar is the running variable over which standardization is done.
In the child development context, this is typically age, but in other contexts,
different variables could be used. For example, to calculate a measure of
height-standardized basketball skill, the test variable could be number of baskets made
in 1 minute and the running variable is height. The age variable should be an
integer when continuous is not chosen.

[varlist] are additional categorical variables over which to standardize,
such as sex or language

Main

binwidth(#) number of units of agevar that establishes the
interval in which the test scores of children will grouped for standardized. Default is 1.
Cannot be used with the option continuous.

minbinsize(#) minimum number of observations in a bin. For bins
with fewer than #, stndzxage changes the values of stx_testvar
to missing. Default is 30. When continuous is specified, binwidth refers to the minimum
number of observations required in the bins defined by varlist
(and the reference variable, if indicated).

continuous Instead of standardizing over subgroups of age,
the entire age span is used for fitting means and standard deviations using a
polynomial of degree specified in the option polynomial. The default is a
third-degree polynomial. Cannot be used with minbinsize. Default is to
standardize using the discreet age bins.

polynomial(#) A polynomial of degree # is used to generate the
age-specific means. Option continuous must be specified. Default is 3.

reference(varname) The mean and standard deviation used in standardizing
is generated only using observations for which varname=1, and these reference
means and standard deviations are applied to the entire population. varname
must only have 0 & 1 values. Default is to standardize using the entire population.

ceiling applies a Tobit estimation of the mean using the maximum value of testvar as the ceiling.

floor applies a Tobit estimation of the mean using the minimum value of testvar as the floor.

mean(#) adjusts the standardization to the indicated mean # instead of the default 0.

sd(#) adjusts the standardization to the indicated standard deviation #
instead of the default 1.

median allows for normalization with respect to the median rather
than the mean. Default is mean. Cannot be used with continuous, floor or ceiling.
(Note:

graph generates diagnostic graphs. Needs the user-written command
grc1leg installed.

Description

Child ability is often age dependent; standardizing assessments of child development
by age can be helpful for comparisons. For example, children’s test scores are
dependent on age and a wealth index, but a two-dimensional graph showing standardized
scores by wealth is simpler to illustrate. Similarly, standardized scores can
also be helpful in comparing results on different tests.

When external norms for standardizing scores are not available or not recommended
to implement, as in the case with cross-cultural applications of tests, the
researcher can standardize the test within the population.

A number of child development assessments vary the questions given based on the
child's age (Ages & Stages Questionaire, for example). Thus the standardization
of these scores should maintain these age groupings to obtain comparability. The
score of a 3-month old child should not be standardized with the scores of a
4-month old child because the questions the parent answers are different. In this
case, a categorical variable can be specified to indicate question set. When this
variable is used in addition to the age variable, stndzxage ensures that
the standardization is done separately for each subgroup (question set)

If a researcher wishes to standardize by question set, but there are different
ages for which each question set is applied, the categorical variable indicating
which question set was administered can substitute for the age variable in the
command line.

stndzxage provides discrete and continuous methods by which
within-population age-standardized scores are computed.

1.Discrete intervals With this method, the population is divided into
discrete groups. The grouping criteria can be chosen to account for the density
of the data over age. Large populations can group fewer age units while smaller
populations may require wider bins.

To ensure sufficient density of the population for standardization, use
minbinsize to indicate the minimum number of observations in each bin.
Then use the option binwidth to indicate how many units of agevar are
combined in an age bin. Bin formation always starts with the youngest age.
All age levels are included even if there are no individuals of that a given age
in the data. If the last group contains just one age unit, it is combined with
the previous group, unless winsize is 1. See examples below:

Values of agevar in data set | binwidth | Resulting intervals
-----------------------------|----------|---------------------
4, 5, 6, 7, 8, 9, 10 | 2 | 4-5, 6-7, 8-10
4, 5, 7, 8, 10, 11, 12, 13 | 4 | 4-7, 8-11, 12-13
4, 5, 7, 8, 10, 11, 13 | 4 | 4-7, 8-11, 12-13
4, 5, 7, 8, 9, 10, 12 | 4 | 4-7, 8-12

stx_testvar is assigned a value of missing if the number of observations in each
bin (defined by binwidth and categorical variables var1, var2, etc.) is less
than the specified minbinsize. The default minimum bin size is 30.

2.Continuous Data from children across the entire age range may be used to
determine the mean and standard deviation. stndzxage uses a polynomial,
with the degree to be chosen using the option poly(#). The default is
a 3rd degree polynomial, as has been used before in the literature (Rubio-Codina).
The age dependent standard deviation is calculated similarly by fitting a
a polynomial (of the same degree indicated by poly(#)) to the absolute
value of the residuals. A kernel smoothing option (e.g. lowess) is currently not
provided because this does not allow for the Tobit adjustment.

3.Other features Sometimes subpopulations require different standardizations,
such as males and females. Categorical variables can be listed after the age
variable to indicate further divisions of the data. In the discrete process,
the age bins align for all subpopulations.

A reference population may be chosen, indicated by a binary variable. In
this case, the standardization procedures described above are performed only
on the reference population, and then these norms are used to calculate
standardized scores for the rest of the population. Age distributions of
the two populations might not always match, so depending on criteria for bin
width and size, there may be some individuals who remain with unstandardized
scores.

One can standardize using the median instead of the mean, but this is
available only in the discrete case. The standard deviation is still generated
around the mean, however. The mean and sd options are useful for
situations where child development scores are standardized with a mean of 100
and a standard deviation of 15, as is common in the literature.

A diognostic graph can be produced to assess if the standardization choices
were appropriate. If a reference group was chosen, only the data from the
reference group is presented. For each integer of age, the raw data graph(s)
show means (or median) used in standardization along with the actual test scores.
The standardized graph shows the standardized test scores and thier means. If
the standardized graph does not appear relatively flat, the researcher may wish
to consider other standardization options (e.g. continuous instead of bins).

Examples

. stndzxage ppvt agemonths

. stndzxage ppvt agemonths, continuous graph

. stndzxage ppvt agemonths SES, ref(boy) minbinsize(30) binwidth(3) mean(100) sd(15)

Acknowledgements

Thanks to Soledad Martinez, Ann Weber, Beth Prado, & Lia Fernald

Author

Sarah Anne Reynolds

School of Public Health

University of California, Berkeley

sar48@berkeley.edu