Strange Stata issue.
For unclear reasons, Stata recently added a number of observations with bizarre, very small or very large values (eg, height and weight vars in attached screenshot). Other vars have seemingly random characters added in these observations (eg, tc variable in screenshot). These values clearly do not make sense for the variables in which they appear and the observations were not in the original dataset.
These values appeared seemingly out of nowhere, and did not follow a merge command. They seem to have appeared after running the loop pasted below, though I can't be certain exactly when these observations appeared. I'm using Stata 12 (a bit outdated I know but works for me).
What might be causing this problem?
************************************************** **********************
capture noisily drop lastwt_ind
capture noisily gen lastwt_ind =.
label var lastwt_ind "most recent sess-associated wt by participant"
levelsof mid, local(mids)
foreach mid of numlist `mids' {
sum cdt if mid==`mid' & weight !=.
capture noisily replace lastwt_ind=1 ///
if mid==`mid' & cdt==`r(max)'
}
Related Posts with Stata added observations with very small or very large values
Problem manipulating large database based on conditional statements to eliminate specific observationsHello world of stats and analysis, I have dibbled a bit in STATA over my university years but my wo…
How i can see only interesting for me models.For example i have 100 columns named var... I wrote code for them like this: Code: xtmixed Y X1 X2…
Nesting an Iv in Diff-in-DiffHello everyone, I would like to ask one question that I am struggling on. I would like to estimate …
How to create an indicator of total vocabulary score for bilingual childrenHi all, I am using a dataset with vocabulary data for 5585 children who are 2 years old. We have a…
Setting a dummy if names appear in the previous year!Dear All, Suppose that I have data Code: * Example generated by -dataex-. To install: ssc install …
Subscribe to:
Post Comments (Atom)
0 Response to Stata added observations with very small or very large values
Post a Comment