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" <[email protected]>
To   [email protected]
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: [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index