Dear Mr/Mrs
I am Lili Puspita Rahayu, student from magister third level of Statistics in Bogor Agriculture University. Mr/ Mrs, now I'm analyzing the Zero inflated Poisson (ZIP), which is a solution of the Poisson regression where the response variable (Y) has zero excess. ZIP now I was doing did not use real data, but using simulated data in R. Simulations by generating data on variables x1, x2, x3 with each size n = 100, after which generate data on response variable (Y). However, when I generate the variable y, after generating variables x1, x2, x3, then the simulation result in the variable y that does not have a zero excess. Sometimes just a coincidence there are 23%, 25% the proportion of zero on the variable Y. This is because I generate variables x1, x2, x3 with a distribution that has a small parameter valuesââ. I've been consulting with my lecturer, and suggested to generate variable Y that can control the proportion of zero on ââZIP analysis. I've been trying to make the syntax, but has not succeeded.I would like to ask for assistance to R to make the syntax to generate simulated Y variables that can control the proportion of zeros after generating variables x1, x2, x3 on ZIP analysis.Thus, I can examine more deeply to determine how much the proportion of zeros on response variable (Y) that can be used in the Poisson regression analysis, parametric ZIP and ZIP semiparametric. syntax that I made previously by generating variable y without being controlled to produce zero excess in R : > b0=1.5 > b1=-log(2) > b2=log(3) > b3=log(4) > n=100 > x1<-rnorm(n, mean=5, sd=2) > x2<-runif(n, min=1, max=2) > x3<-rnorm(n, mean=10, sd=15) > > y<-seq(1,n) > for(i in 1:n) + { + m<-exp(b0+b1*x1[i]+b2*x2[i]+b3*x3[i]) + yp<-rpois(1,m) + y[i]<-yp + } I am very grateful for the assistance of R. I am looking forward to hearing from you. Thank you very much. Sincerely yours Lili Puspita Rahayu [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.