You can use the followings: lp<- -5+..... #linear predictor y<-rbinom(length(lp), size, plogis(lp))
Note that size means your "denominator" in proportions to be simulated. For instance, if you want binary data use size=1. best, vito ----- Original Message ----- From: Michele Grassi <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 09, 2003 11:38 AM Subject: [R] simulate binary data from a logistic regression model > Hi. > How can i simulate a binary data set from a logistic > regression model?I need to manipulate parameters and so > obtain my set of data. > I want to show the improve in analyzing binary data > with GLM(binomial) model instead of classical ANOVA or > NON-MODELS procedures(relative risk-odds ratio-Pearson > test of godness of fit...) > Can you say me what is the right function to use? > Do you know any interesting simulation in the web? > > Thank you. > Michele. > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help