significance test for yes/no data in R I have the following data format:
id     drug_type     result
--     ---------     ------
1      A             Yes
2      B             No
3      A             No
4      Placebo       Yes
.
.

How do I test the result column for significance of each drug_type that is not Placebo, against the Placebo. Usually I would take subsets of the table based on drug_type and do: 
t.test(drugA,placebo)

however I know I should not be using a t-test for categorical data. The prop.test handles categorical variables, but to me does not seem to be able to compare each non-Placebo drug group to the placebo, but merely run significance test on the proportion of successful tests within each drug_type.
any suggestions? 
 A: How about logistic regression -- especially if you have other factors that you need to control?  You can simply set up a contrast to test differences in drug types.
For example:
id<-seq(1, 100)
drug_type<-as.factor(sample(c(LETTERS[1:2], "Placebo"), size=100, replace=TRUE))
result<-as.factor(sample(c("Yes","No"), size=100, replace=TRUE))
mydf<-data.frame(id, drug_type, result)
mydf2<-cbind(mydf, result2=as.numeric(mydf$result)-1)
head(mydf2)

mymodel<-glm(result2~drug_type, data=mydf2, family="binomial")
summary(mymodel)

install.packages("aod")
library(aod)
L<-cbind(0, 1, -1)
#For example to test Test Drug B against Placebo
wald.test(b = coef(mymodel), Sigma = vcov(mymodel), L = L)

A: I think a Chi-square test would be appropriate for your situation, provided that you have in each cell more than 5 observations (i.e., in your case ID's).
What you need to do is make a 2 x 2 contingency table of drug type (A vs B) and Result (Yes vs No) and count the occurrences in each cell. You can than test if there is an association between the two variables. See for examples of medical research the following link: http://ocw.jhsph.edu/courses/fundepiii/pdfs/lecture17.pdf
In R the function chisq.test(table) can be used.
