Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Dropping observations in relation to mean and standarddeviation


From   Friederike Ballaire <[email protected]>
To   [email protected]
Subject   st: Dropping observations in relation to mean and standarddeviation
Date   Tue, 21 Jan 2014 16:57:42 +0100

Hi,
I tested 144 people and now I need to drop observation that are more
than three standarddeviations away from the mean of two variables for
one subject.

So far I calculated the standard deviation and the mean of v1 and v2
if subject number = 10011.

my syntax lokks like this:
preserve
stack v1 v2 if subject ==10011, into(v3) clear
tabstat v3, statistics( mean sd ) columns(variables)
restore

Now I want to delete all data that is more than three standard
deviations away from the mean.

Is there a special command for that?
Otherwise I would just calculate the mean and standarddeviation for
every subject and then calculate three standard deviations away from
the mean and use the drop command.

Thanks for your help!
Friederike Ballaire
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index