outcome2<-subset(outcome, State>=20)When I then type: > table(outcome2$State), my table in outcome2 is the same as outcome, with none of the data being removed.
outcome <- data.frame(State = c(10, 20, 30), StateName = c("AL", "AK", "AR"))
sapply(outcome, data.class)State StateName
outcome2 <- subset(outcome, State >=20)
head(outcome)and the class of each variable:
sapply(outcome, data.class)This will help us narrow down the problem. Thanks!
table(outcome$State)I can see how many hospitals in each state there are. My data shows AK = 17, AL=98, AR=77 ... WY=29.