​Suppose that I am using the system data set auto and I only want to look at two variables, lets say weight as the independent var and mpg as the dependent var. Additionally lets say I want to compress the data set just down to 5 observations and those 5 are either elements of the IQR or the next closest thing. I know how to get the IQR, set local macros for the min, max, r(p25), r(p50), r(p75), but there are times when those percentiles are not actually elements of the vector. (ie. the median of weight is 3190, and that is not an element of weight.) Is there a way I can tell Stata that if that percentile is not in the vector to use the next closest above observation? I need to get down to 5 observations and 5 responses for this project that I am doing....
-
Login or Register
- Log in with
Comment