Skip to content
Back to formatted view

Raw Message

Message-ID: <48DBEEAB.7030600@partners.org>
Date: 2008-09-25T20:03:55Z
From: Nina Paynter
Subject: solving for beta0 in a logsitic regression

Hi all,

I am trying to create simulated data for exploring reclassfication 
measures in a logistic setting with two continuous predictors and I 
would like to set the average population probability of outcome rather 
than the logistic beta0. Is there a way to find a beta0 that will 
generate the desired average population probability of outcome given x,y 
and their odds ratios? 

#Here is an outline of what I would like to do:
    pop.d=0.1
   xvar=rnorm(5000,0,0.5)
   yvar=rnorm(5000,0,0.5)
    orx=16
    ory=2

#find beta0
beta0=f(x,y,orx,ory,pop.d)
#actual function pop.d=Integral(exp(beta0 + log(orx)*x + log(ory)*y)/(1 
+ exp(beta0 + log(orx)*x + log(ory)*y))dx dy)

    #create linear log odds functions for the outcome with x and y
    log.odds.xy = beta0 + log(orx)*xvar + log(ory)*yvar
   

    #create outcome variable based on x only and on x and y
    out =rbinom(5000,1,plogis(log.odds.xy))

#where E[mean(out)]=pop.d

Thanks,
Nina


The information transmitted in this electronic communica...{{dropped:16}}