*! version 1.0.0 11May2026

Title

gtcsem -- Conditional standard errors of measurement in
Generalizability Theory

Syntax

gtcsem varlist [if] [in]
[, options]

where varlist contains two or more numeric variables holding the
item-level scores for a single-facet, fully-crossed persons-by-items
(p x i) design.

Estimator
method(string) full, large_a,
uncorrelated, or all; default is full

semethod(string) analytical, bootstrap,
or both; default is analytical

nitemsd(#) number of items for D-study extrapolation;
default is the number of observed items

cutpoint(#) cutpoint lambda for Phi(lambda);
not computed by default

Smoothing
smooth fit a quadratic smoother of each error variance
on the observed score

excludeextremes exclude floor/ceiling cases from the
quadratic fit (requires smooth)

Bootstrap
bootb(#) number of bootstrap replications;
default is bootb(1000), minimum 100

bootseed(#) seed for the bootstrap;
default is bootseed(0) (no seed set)

nodots suppress per-person bootstrap progress dots

Output variables
generate(name) prefix for the generated variables;
default is generate(csem)

replace overwrite generated variables if they already
exist

Truncation
truncneg set negative per-person error variances to zero
before taking the square root

truncvc set negative ANOVA variance components to zero

varlist must contain at least two numeric variables; the design
is required to be balanced and complete (no missing values).

Description

gtcsem estimates conditional standard errors of measurement
(CSEMs) under Generalizability Theory for a univariate, single-facet,
persons-by-items (p x i) crossed design. Whereas the overall
(population) SEM summarizes measurement precision averaged across
the population, the CSEM characterizes the precision of the
measurement for an individual at a given score level (Brennan,
1998). This is the relevant index when measurement decisions are
made about persons rather than groups, including the assessment of
the local accuracy of cut-score classifications.

Unlike most other psychometric models, Generalizability Theory
distinguishes two types of conditional measurement error. The
absolute CSEM is appropriate when decisions concern the
absolute magnitude of a person's score (for example, mastery
classification against a fixed cutpoint), whereas the relative
CSEM is appropriate when decisions concern comparisons among
persons (for example, ranking or selection) (Brennan, 1998).

For each person p, gtcsem returns the absolute conditional
error variance (Brennan, 1998, eq. 20) together with up to three
estimators of the relative conditional error variance corresponding
to alternative simplifying assumptions about the population:

o full -- Brennan (1998, eqs. 35-36); no
simplifying assumption about the number of persons.

o large_a -- Brennan (1998, eq. 40); takes the
limit as the number of persons A grows large.

o uncorrelated -- Brennan (1998, eq. 41); also
assumes that the within-person item-by-residual covariance is
zero.

Standard errors of these per-person estimators are obtained
analytically (closed-form formulas conditional on items, under
Gaussianity of the residuals) or via an item-resampling bootstrap.
The command also reports the standard generalizability coefficient
(E rho^2; Brennan, 2001, eq. 2.40), the dependability coefficient
(Phi; eq. 2.41), and, when a cutpoint is supplied, the dependability
coefficient for mastery decisions Phi(lambda) (Brennan & Kane, 1977;
Brennan, 2001, eq. 2.55).

Options

Estimator

method(string) selects the estimator of the per-person
relative error variance. full (the default) implements
Brennan (1998, eqs. 35-36) without any simplifying assumption.
large_a implements eq. 40, which drops the finite-A
correction by taking A to infinity. uncorrelated
implements eq. 41, which additionally assumes that, conditional on
the focal person, the covariance between item difficulty and the
person-by-item residual is zero. Specifying all computes the
three estimators jointly so that they can be compared.

semethod(string) selects how the sampling variance of each
per-person estimator is computed. analytical (the default)
returns exact closed-form variances derived under the assumption
that residuals are Gaussian and conditional on the observed item
mean structure; under that model the sampling variance does not
depend on the focal person, so it is reported as a constant across
persons. bootstrap replaces the analytical formula with a
nonparametric item-resampling bootstrap that resamples item indices
with replacement and recomputes the focal estimator at each
replication. both returns both, which is useful for
diagnostic comparison.

nitemsd(#) performs a D-study extrapolation: the per-person
error variances and the population variance components are projected
to a hypothetical decision study with # items per person, while
keeping the variance-component estimates from the observed G-study
unchanged. When nitemsd(#) is omitted, the D-study item
count equals the number of observed items.

cutpoint(#) requests the dependability coefficient for
mastery classifications, Phi(lambda), at cutpoint lambda = #
(Brennan & Kane, 1977; Brennan, 2001, eq. 2.55). Phi(lambda)
quantifies the proportion of variance among the observed deviations
from the cutpoint that is attributable to true (rather than error)
deviation, and is the appropriate dependability index when scores
are used to make criterion-referenced decisions.

Smoothing

smooth fits a quadratic regression of each per-person error
variance on the observed score (Brennan, 2001, p. 162). Because
the fit is by ordinary least squares, the mean of the smoothed
values equals the mean of the unsmoothed values. Smoothed CSEMs
are recovered as the square root of the smoothed error variance.

excludeextremes excludes from the quadratic fit those persons
whose responses are all at the empirical minimum (floor) or all at
the empirical maximum (ceiling) across varlist. Such cases are
structurally degenerate (zero within-person item variance) and can
unduly influence the smoother. Smoothed values for the excluded
cases are returned as missing. Requires smooth.

Bootstrap

bootb(#) sets the number of bootstrap replications used per
person when semethod(bootstrap) or semethod(both) is in
effect. Default is 1000; the minimum permitted is 100.

bootseed(#) sets the random-number seed before the bootstrap
loop, ensuring reproducibility. The default value of 0 leaves the
current seed untouched.

nodots suppresses the progress dots printed during the
bootstrap. By default a dot is printed every k persons, where
k is chosen so that the bootstrap finishes in roughly 200 dots.

Output variables

generate(name) sets the prefix used for all generated
variables. Default is csem. See Remarks
for the full list of generated variables.

replace drops any pre-existing variable with a generated name
before regenerating it. Without replace, the command exits
with an error if any target variable already exists.

Truncation

truncneg sets negative per-person error variances to zero
before taking the square root, so that the corresponding CSEM is 0
rather than missing. Without truncneg, persons with negative
estimated error variance are assigned a missing CSEM.

truncvc sets to zero any ANOVA variance component (sigma^2(p),
sigma^2(i), sigma^2(pi)) that is estimated as negative. This affects
all downstream quantities that depend on the truncated component.

Remarks

Generated variables. All generated variables share the prefix
specified by generate(name) (default csem). In what
follows the prefix is denoted by p. Suffixes are kept short to
fit within Stata's 32-character variable-name limit when
method(all) is requested.

o p_score -- observed person mean (sum
score divided by the number of items).

o p_abs_ev, p_abs_csem --
absolute conditional error variance and SEM.

o p_cov_xim -- per-person covariance
between item scores and item difficulties (the c_p building
block of Brennan, 1998).

o p_vabs_an, p_vabs_bs --
analytical and bootstrap variance of the per-person absolute error
variance estimator (the bootstrap column is present whenever
semethod(bootstrap) or semethod(both) is in effect).

o p_rel_ev, p_rel_csem,
p_vrev_an, p_vrev_bs -- relative
conditional error variance, CSEM, and (analytical/bootstrap) SE
under the selected method. When method(all) is specified,
the suffixes _full, _la, and _unc provide each
of the three estimators separately, and the unsuffixed variables
(p_rel_ev etc.) duplicate the full estimator for
convenience.

o When smooth is in effect, each
..._ev/..._csem pair has a parallel ..._ev_sm/
..._csem_sm pair containing the quadratic-smoothed values.

Returned matrices. In addition to the generated variables, the
command stores variance components (r(vc)), the ANOVA table
(r(anova)), the population-level error variances and SEMs
(r(overall)), and the reliability-like coefficients
(r(coefficients)). When smooth is in effect, a matrix
r(smooth_fits) contains the coefficients (b0, b1,
b2), R^2, RMSE, and sample size of every quadratic fit.
When the bootstrap is run, r(boot) returns the per-person
mean bootstrap variances for the four estimators.

Reproducibility across calls. gtcsem also stores the
prefix and the estimation options as dataset characteristics
(char _dta[gtcsem_prefix], char _dta[gtcsem_method],
char _dta[gtcsem_smooth], char _dta[gtcsem_excludeextremes]).
gtcsem_plot reads these characteristics so that plots remain
available even after intervening r-class commands have wiped
r().

D-study extrapolation. When nitemsd(#) differs from
the number of observed items, all per-person and population-level
error variances are scaled to a decision study with # items
while keeping the G-study variance components unchanged. This is
the standard D-study transformation: sigma^2(I) = sigma^2(i)/n_i'
and sigma^2(pI) = sigma^2(pi)/n_i' (Brennan, 2001, eqs. 2.26-2.27).

Limitations. The command currently supports only the
univariate, single-facet, fully-crossed design (one set of items
administered to all persons). Missing item scores are not allowed;
data must be balanced and complete. More general designs (nested,
multifacet) are not implemented.

Examples

Default estimator (method(full)) with analytical SE:

. gtcsem item1-item10

All three relative-error estimators with quadratic smoothing
of the per-person error variances:

. gtcsem item1-item10, method(all) smooth

Bootstrap SE with a reproducible seed:

. gtcsem item1-item10, semethod(bootstrap) bootb(2000) bootseed(123)

Comparison of analytical and bootstrap SE in a single call:

. gtcsem item1-item10, semethod(both) bootseed(123)

D-study extrapolation: project to a 20-item form:

. gtcsem item1-item10, nitemsd(20)

Dependability for a cutpoint of 7:

. gtcsem item1-item10, cutpoint(7)

Smoothing while excluding floor/ceiling cases from the fit:

. gtcsem item1-item10, smooth excludeextremes

Use a custom prefix for the generated variables:

. gtcsem item1-item10, generate(myrun)

Re-run the command, overwriting any pre-existing generated
variables:

. gtcsem item1-item10, method(all) smooth replace

Stored results

gtcsem is r-class and stores the following in r().

Scalars

r(A) number of persons

r(I_observed) number of observed items

r(nitems_D) number of items in the D-study

r(sigma2_p) variance component for persons

r(sigma2_i) variance component for items

r(sigma2_pi) variance component for persons-by-items
(residual)

r(absolute_error_var) sigma^2(Delta)

r(absolute_sem) sigma(Delta)

r(relative_error_var) sigma^2(delta)

r(relative_sem) sigma(delta)

r(erho2) generalizability coefficient Erho^2

r(phi) dependability coefficient Phi

r(phi_lambda) dependability for cutpoint
(only with cutpoint())

r(cutpoint) cutpoint value
(only with cutpoint())

r(bootb) number of bootstrap replications
(only with bootstrap)

r(bootseed) bootstrap seed
(only with bootstrap)

r(n_floor) number of floor cases
(only with excludeextremes)

r(n_ceiling) number of ceiling cases
(only with excludeextremes)

r(n_fit) sample size of the smoothing fit
(only with excludeextremes)

Macros

r(method) selected estimator

r(semethod) selected SE method

r(prefix) prefix used for the generated variables

r(smooth) smooth if smoothing was applied,
empty otherwise

r(excludeextremes) excludeextremes if applied,
empty otherwise

Matrices

r(vc) 1 x 3 vector of variance components

r(anova) 3 x 4 ANOVA table (df, SS, MS, sigma^2)

r(overall) 4 x 1 column of population-level error
variances and SEMs

r(coefficients) coefficients column (Erho^2,
Phi, and Phi(lambda) when applicable)

r(smooth_fits) per-quantity quadratic-fit diagnostics
(only with smooth)

r(boot) A x 4 matrix of per-person bootstrap
variances of the absolute and three relative estimators
(only with bootstrap)

References

Brennan, R. L. (1998). Raw-score conditional standard errors of
measurement in Generalizability Theory.
Applied Psychological Measurement, 22(4), 307-331.
https://doi.org/10.1177/014662169802200402

Brennan, R. L. (2001). Generalizability Theory.
Springer-Verlag.

Brennan, R. L., & Kane, M. T. (1977). An index of dependability for
mastery tests. Journal of Educational Measurement, 14(3),
277-289.

Cronbach, L. J., Gleser, G. C., Nanda, H., & Rajaratnam, N. (1972).
The dependability of behavioral measurements: Theory of generalizability for scores and profiles.
Wiley.

Author

Rene Gempp

Facultad de Administracion y Economia, Universidad Diego Portales, Santiago, Chile

Email: rene.gempp@udp.cl

Citation

Please cite this software as:

Gempp, R. (2026). gtcsem: Stata module to compute conditional standard errors of measurement in Generalizability Theory (Version 1.0.0).
Statistical Software Components S459702, Boston College Department of Economics.

Support and updates

Bug reports, feature requests, and the development version are
available at https://github.com/rgempp/gtcsem.

Also see

Help: gtcsem_plot