Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: marksample, byable


From   Herb Smith <hsmith@pop.upenn.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: marksample, byable
Date   Fri, 15 Sep 2006 10:45:40 -0400 (EDT)

I have a program that I want to be able to run on variable after variable,
within strata (or "by" subgroups).

The program takes a `varlist' as input.

Now, as far as I can tell, when I do a

. marksample `touse'

even before I get to the "byable" aspects of the problem, Stata is marking
my sample so that all cases with any missing data on any variable is being
marked out of the sample...?

I understand this if my `varlist' is being used to run, for example, some
sort of regression.

But I am doing a set of procedures (weighting estimators, for a sampling
issue), on each variable, one at a time.

I realize that I could just change the program to work on `varname'--i.e.,
one variable at a time--and just write a little front end loop outside the
program; but, in addition to being inelegant, it makes it more difficult
to cumulate and compare results between variables.

My questions:

Am I understanding what "marksample" is up to, and, if so, is there a
trick for getting the "marksample" to relax, i.e., not to do what is
effectively listwise deletion of cases?


Herbert L. Smith
Professor of Sociology and
Director, Population Studies Center
230 McNeil Building
3718 Locust Walk CR
University of Pennsylvania
Philadelphia, PA  19104-6298

hsmith@pop.upenn.edu

215.898.7768 (office)
215.898.2124 (fax)
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index