help sdlim-------------------------------------------------------------------------------

Titlesdlim -- Rescaled standard deviations for limited variables

SyntaxSyntax 1: Rescaled standard deviations for many variables

sdlimvarlist[if] [in] [weight],limits(# #)} [simulate(# #)}keep]

Syntax 2: Rescaled standard deviations by groups

sdlimvarname[if] [in] [weight],by(varname)[limits(# #)}simulate(# #)}keep]

aweights, andfweights are allowed; see weight.

byis allowed; see by.

Description

sdlimrescales the standard deviation of a variable such that the result is the proportion of the raw standard deviation at the maximum standard deviation for a given mean.The theoretical maximum of the standard deviation of the variable X with mean = mean(X) is

max(SD) = sqrt((min(X) - mean(X)) * (mean(X)-max(X)) * N/(N-1))

The formula assumes that the mimimum and the maximum of X is known and fixed. This is the case for variables measured with a rating scale, for example.

sdlimhas two syntaxes. Syntax 1 is used to to rescale the standard deviations of various variables. In this case the optionlimits()mustbe used. Syntax 2 is used to rescale the standard deviation ofonevariable for different groups. In this case the optionby()is required, while the specification of avarlistbehind the command is not allowed.

Options

limits(# #)is used to set the theoretical limits of the variable(s) for which the standard deviation should be rescaled. Limits are set by two interger numbers. The first number is the theoretical minimum of the variable the second number is the theoretical maximum. Results are omitted if variables contain values outside its theoretical boundaries. Note that the option is required if the command is given without optionby()(i.e. for Syntax 1). For Syntax 2limits(# #)defaults to the minimum and maximum value of varname over all by-groups.

by(varname)is used to compare rescaled standard deviations between groups defined by categories of varname. With option by(), rescaling of standard deviation can be done for only one variable.

simulate(# #)uses a simulation to rescale the standard deviation of a variable measured with a limited rating scale. The simulation assumes a latent variable with the mean of the observed variable and a given standard deviation. It further assumes that all values of the latent variable that exceed the specified limits are set to the highest and lowest value of the observed variable. Inside the parentheses the option requires two numbers. The first number is the number of observations used in the simulation, the second number is the standard deviation of the latent variable.

keepis used to keep in memory the results ofsdlimas a Stata data set (i.e. a resultsset)

Examples

. sysuse auto. sdlim rep78, l(1 5). sdlim rep78, by(for). sdlim rep78, by(for) l(1 9)

. sdlim rep78, by(for) l(1 9) sim(1000 2)

Saved results

sdlimdoes not save returns. However with optionkeepkeep the results are kept in memory as a resultsset.

AcknowledgmentThe formula for the maximum standard deviation is published in Kalmijn, Wim and Ruut Veenhoven, 2005: Measuring inequality of happiness in nations. In search for proper statistics. Journal of Happiness Studies 6, 357-396 (Special issue on "Inequality of Happiness in nations").

The two methods for rescaling of standard deviations are discussed by Delhey, Jan and Kohler, Ulrich: Is Happiness Inequality Immune to Income Inequality? New Evidence through Instrument-Effect-Corrected Standard Deviations. This article is currently under review in Social Science Research.

AuthorUlrich Kohler, WZB kohler@wzb.eu

Manual:Also see[R] summarize