Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: appended datasets and trying to drop variables


From   "Richard. Williams" <Richard.A.Williams.5@nd.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: appended datasets and trying to drop variables
Date   Tue, 09 Aug 2005 13:38:30 -0500

At 01:24 PM 8/9/2005, Suzy wrote:
Dear Statalistmembers,

I've appended 2 datasets with identical variables (columns). I'm trying to drop certain variables, but notice that it duplicates my observations/IDs. Although both datasets have identical variables, the second dataset has only (.) missing values of the variable. I'm not sure if that should affect my ability to drop variables. Is there a quick fix with this? I'm using Stata 9.0.
The first question is, did you append correctly? Do the same identical cases appear in both data sets, hence leading to your duplicated observations? If so, it seems like you need to clean that up. Does the 2nd data set really have all missing values on the variable or variables, or did it just become that way when you did the append? I'm wondering whether you actually appended or did some kind of merge. Unless you expect things to be happening the way you are describing, you may want to double-check what you did.

In any event, it is pretty easy to drop variables; just say -drop varname-. The presence of missing data does not affect your ability to do that. It sounds to me like the bigger issue is whether the append was done right in the first place.


-------------------------------------------
Richard Williams, Associate Professor
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: Richard.A.Williams.5@ND.Edu
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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