Sunday, March 19, 2006

Re: st: dropped observations after append

Michael: I am not able to reproduce your problem. What are you doing differently from the example below? One thing that jumps to mind is that in your output a dset 0 is immediately followed by a dset 1, while if you just appended it all dset 0 should be underneath. Maybe something went wrong in a past version of dset1.dta and you are pasting correctly underneath but if you look at the first few lines you still see the mistakes made earlier.

*----------------begin example------------------ set more off drop _all

input id dset agev male meduse afev1 2 0 10 1 0 -9 6 0 11 0 1 -9 15 0 11 1 1 -9 18 0 7 1 1 -9 20 0 10 1 1 -9 end save c:\temp\dset2.dta /*, replace*/ drop _all

input id dset agev male meduse afev1 2 1 10 1 1 1.700833 6 1 11 0 0 2.084792 15 1 11 1 0 1.499583 18 1 7 1 0 1.183437 20 1 10 1 0 1.400417 end

append using c:\temp\dset2.dta /*erase c:\temp\dset2.dta*/ list

*---------------end example------------------

HTH, Maarten

--- Michael McCulloch <mm@pinest.org> wrote:

> Thanks Maarten; dset is float %9.0g in both datasets. > > At 04:42 PM 3/19/2006, you wrote: > >Michael: > >Is the variable dset in dset1.dta a string? (open dset1.dta and type -desc > >dset- to find out) > >HTH, > >Maarten > > > >--- Michael McCulloch <mm@pinest.org> wrote: > > > > > I have two datasets, (dset1.dta and dset2.dta). > > > With dset1.dta, I append with the command: append using dset2.dta. > > > > > > dset1.dta has: > > > id dset agev male meduse afev1 > > > 2 1 10 1 1 1.700833 > > > 6 1 11 0 0 2.084792 > > > 15 1 11 1 0 1.499583 > > > 18 1 7 1 0 1.183437 > > > 20 1 10 1 0 1.400417 > > > > > > dset2.dta has: > > > id dset agev male meduse afev1 > > > 2 0 10 1 0 -9 > > > 6 0 11 0 1 -9 > > > 15 0 11 1 1 -9 > > > 18 0 7 1 1 -9 > > > 20 0 10 1 1 -9 > > > > > > After I append, why are values from the first dataset dset1.dta for the > > > variable dset==1 are dropped? > > > id dset wheeze cough meduse afev1 male agev height > > > anysx > > > 2 0 0 0 0 -9 1 10 137.922 > > > 0 > > > 2 . 0 0 1 1.700833 1 10 > > > 137.922 0 > > > 6 . 0 1 0 2.084792 0 11 > > > 150.876 1 > > > 6 0 0 1 1 -9 0 11 150.876 > > > 1 > > > 15 . 0 1 0 1.499583 1 11 > > > 141.986 1 > > > 15 0 0 1 1 -9 1 11 141.986 > > > 1 > > > 18 . 0 0 0 1.183437 1 7 > > > 120.396 0 > > > 18 0 0 0 1 -9 1 7 120.396 > > > 0 > > > 20 . 0 0 0 1.400417 1 10 > > > 150.114 0 > > > 20 0 0 0 1 -9 1 10 150.114 0 > > > > > > > > > > > > > > > Best wishes, > > > Michael > > > > > > > > > ____________________________________ > > > > > > Michael McCulloch > > > Pine Street Clinic > > > 124 Pine Street, San Anselmo, CA 94960-2674 > > > tel 415.407.1357 > > > fax 415.485.1065 > > > email: mm@pinest.org > > > web: www.pinest.org > > > www.pinestreetfoundation.org > > > > > > > > > > > > > > > > > > * > > > * 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/ > > > > > > > > >----------------------------------------- > >between 1/2/2006 and 31/3/2006 I will be > >visiting the UCLA, during this time the > >best way to reach me is by email > > > >Maarten L. Buis > >Department of Social Research Methodology > >Vrije Universiteit Amsterdam > >Boelelaan 1081 > >1081 HV Amsterdam > >The Netherlands > > > >visiting adress: > >Buitenveldertselaan 3 (Metropolitan), room Z214 > > > >+31 20 5986715 > > > >http://home.fsw.vu.nl/m.buis/ > >----------------------------------------- > > > > > > > >___________________________________________________________ > >Win a BlackBerry device from O2 with Yahoo!. Enter now. > >http://www.yahoo.co.uk/blackberry > >* > >* 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/ > > > Best wishes, > Michael > > > ____________________________________ > > Michael McCulloch > Pine Street Clinic > 124 Pine Street, San Anselmo, CA 94960-2674 > tel 415.407.1357 > fax 415.485.1065 > email: mm@pinest.org > web: www.pinest.org > www.pinestreetfoundation.org > > > > > > * > * 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/ >

----------------------------------------- between 1/2/2006 and 31/3/2006 I will be visiting the UCLA, during this time the best way to reach me is by email

Maarten L. Buis Department of Social Research Methodology Vrije Universiteit Amsterdam Boelelaan 1081 1081 HV Amsterdam The Netherlands

visiting adress: Buitenveldertselaan 3 (Metropolitan), room Z214

+31 20 5986715

http://home.fsw.vu.nl/m.buis/ -----------------------------------------

___________________________________________________________ Yahoo! Photos – NEW, now offering a quality print service from just 8p a photo http://uk.photos.yahoo.com * * 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/


Tag:


Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?