[R] Computing Median for Subset of Data

peter dalgaard pdalgd at gmail.com
Sun Jun 2 09:48:48 CEST 2013


On Jun 2, 2013, at 08:08 , Matt Stati wrote:

>> From my larger data set I created a subset of it by using: 
> 
> subset_1 <- subset(timeuse, IndepTrans = 1, Physical = 1)

That's not going to work. Try

subset(timeuse, (IndepTrans == 1) & (Physical == 1))

(Whenever you do things like this, run summary(subset_1) to check.)

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list