[R] A programming question

From: Anup Nandialath <anup_nandialath_at_yahoo.com>
Date: Fri, 18 May 2007 09:01:39 -0700 (PDT)

Dear Friends,

My problem is related to how to measure probabilities from a probit model by changing one independent variable keeping the others constant.

A simple toy example is like this

Range for my variables is defined as follows

y=0 or 1, x1 = -10 to 10, x2=-40 to 100, x3 = -5 to 5


output <- glim(y ~ x1+x2+x3 -1, family=binomial(link="probit")) outcoef <- output$coef
xbeta <- as.matrix(cbind(x1, x2, x3)

predprob <- pnorm(xbeta%*%outcoef)

now I have the predicted probabilities for y=1 as defined above. My problem is as follows

Keep X2 at 20 and X3 at 2. Then compute the predicted probability (predprob) for the entire range of X1 ie from -10 to 10 with an increment of 1.

Therefore i need the predicted probabilities when x1=-10, x1=-9....,x1=9, x1=10 keeping the other constant.

Can somebody give me some direction on how this can be programmed.

Thanks in advance for your help



Got a little couch potato?

Check out fun summer activities for kids.

        [[alternative HTML version deleted]]

R-help_at_stat.math.ethz.ch 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. Received on Fri 18 May 2007 - 16:35:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 May 2007 - 17:31:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.