Dear Stata list,
I want to generate an error list in a dta file on different conditions for data cleaning. I have searched the command like insertto or appendto but did't find any help in this regard.
for example:
bys hhid: appendto <varlist> if _n > 1 , using errors.dta comment("Duplicates")
bys hhid: insertto <varlist> if _n > 1 , using errors.dta comment("Duplicates")
appendto <varlist> if condition , using errors.dta comment("var1 = 1 and missing(var2)")
I know this can be done via post file after marking such records or using preserve/restore. It would be helpful if this could be done with just one command.
Thanks
Rasool Bux
Related Posts with Insertto or appendto
Assign value randomlyHi, I have a data of 5 clusters, each has 30 observations. I am asked to create a new variable, whi…
Struggling to create this variableHi! For my thesis, I'm interested in the effect of a change in working hours on mental health outco…
splitting a string into a new variableHi in my dataset, I have a variable called AllAvailableHoldersOwned which states the ownership data…
Merging 2 datasets with the same ID numberDear Members, I have been trying to merge 2 datasets. I have household sample and individual sample…
asdasd …
Subscribe to:
Post Comments (Atom)
0 Response to Insertto or appendto
Post a Comment