Update to a program for saving a model fit as a dataset



26


Stata Technical Bulletin


STB-58


Description

The meanscor command performs a weighted logistic regression using the mean score method. This function requires the
complete covariate(s) to be categorical, and the default output contains the regression coefficient estimates and their standard
errors in odds-ratio form.

An important area of application of this function is in the analysis of data from a two-stage study. In this type of study,
some variables are incomplete due to only a subset of the study subjects being sampled at the second stage (Reilly 1996).

Options

f irst Vaarlist) specifies the complete covariates.

second(aαrlist) specifies the incomplete covariates.

odd(#) specifies whether the odds-ratio (odd = 1) or regression coefficients (odd = 0) format is reported. Default value is 1.

Methods and Formulas

The mean score estimates will maximize the weighted likelihood

Z nI(zi,yi)

Σ (1 + √⅛j) ⅛spβ(yih)

where          is the number of incomplete observations in each stratum defined by the different levels of response and

complete covariates Zi, and nc^i,yi^ is the number of complete observations in each stratum.

As the above equation indicates, the mean score method weights each complete observation according to the total number
of observations in the same stratum.

The asymptotic variance of the mean score estimate is given by

Var(3) = ɪ 11v)

where n is total number of observations, and I is the usual information matrix. V is estimated by the matrix

n(y, Z)n1^y'z'>

Σ  nc(y,z)  Var(⅜*)

(У,*)

where Var{Sβ{y, z)) is the variance-covariance matrix of the score in each {y,z) stratum.

We can regard the second term of the variance expression as a penalty for the incompletely observed observations. Hence,
the mean score estimates will have larger variance than the estimates obtained if all observations were complete but smaller
variance than the estimates from an analysis of complete cases only.

Examples

We begin with a simulated dataset. We generated 1,000 observations of a predictor variable x from the standard normal
distribution. The response variable
y was then generated as a Bernoulli random variable with p = ехр(ж)/{1 + ехр(ж)}. A
dichotomous surrogate variable for
x. called z, was generated as one for positive x and zero otherwise.

A random subsample of 500 observations had their x value deleted (set to missing). The dataset, called sim_miss.dta is
provided with this insert as an illustration and can be analyzed using the mean score method by

. use sim-miss

. meanscor у x,first(z) second(x)
meanscore estimates


I

odd-ratio

Std. Err.

z

P>z

[957. Conf.

Interval]

cons I

1.050643

.0751759

0.690

0.490

.9131663

1.208817

X I

2.770173

.282211

10.002

0.000

2.268772

3.382384



More intriguing information

1. A multistate demographic model for firms in the province of Gelderland
2. Towards a Strategy for Improving Agricultural Inputs Markets in Africa
3. Improvement of Access to Data Sets from the Official Statistics
4. INTERACTION EFFECTS OF PROMOTION, RESEARCH, AND PRICE SUPPORT PROGRAMS FOR U.S. COTTON
5. Imputing Dairy Producers' Quota Discount Rate Using the Individual Export Milk Program in Quebec
6. The Mathematical Components of Engineering
7. How much do Educational Outcomes Matter in OECD Countries?
8. Herman Melville and the Problem of Evil
9. The name is absent
10. The Folklore of Sorting Algorithms
11. The name is absent
12. Testing Gribat´s Law Across Regions. Evidence from Spain.
13. The constitution and evolution of the stars
14. The name is absent
15. Regional dynamics in mountain areas and the need for integrated policies
16. BARRIERS TO EFFICIENCY AND THE PRIVATIZATION OF TOWNSHIP-VILLAGE ENTERPRISES
17. The name is absent
18. THE INTERNATIONAL OUTLOOK FOR U.S. TOBACCO
19. The name is absent
20. PROTECTING CONTRACT GROWERS OF BROILER CHICKEN INDUSTRY