-----Original Message-----
From: BXC (Bendix Carstensen)
Sent: 15. juli 2010 18:34
To: 'Adaikalavan Ramasamy'
Subject: RE: comparing coefficients when different parameterization is used
In matrix multiplication you can define the relationship of the coefficients between the parametrizations by a matrix CM, say:
CM <- rbind( c(1, 1,0,0, 0),
c(0,-1,0,0, 0),
c(0, 0,1,0, 1),
c(0, 0,0,1, 0),
c(0, 0,0,0,-1) )
You can easily verify this by:
cbind( coef(f2), CM %*% coef(f1) )
Now in the Epi package is a function ci.lin, that computes linear combinations of coefficients with the corresponding standard errors:
library(Epi) # You need to install this package first ci.lin( f1, ctr.mat=CM ) ci.lin( f2 )
If the variance-covariance of the coef(f1) is V, say, then the variance-covariance matrix of CM %*% coef(f1) is CM %*% V %*% t(CM), which is basically what is implemented in ci.lin().
Best regards,
Bendix
(maintainer of the Epi package)
_______________________________________________
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2-4
DK-2820 Gentofte
Denmark
+45 44 43 87 38 (direct)
+45 30 75 87 38 (mobile)
[log in to unmask] http://www.biostat.ku.dk/~bxc
www.steno.dk
> -----Original Message-----
> From: A UK-based worldwide e-mail broadcast system mailing list
> [mailto:[log in to unmask]] On Behalf Of Adaikalavan Ramasamy
> Sent: 14. juli 2010 10:18
> To: [log in to unmask]
> Subject: comparing coefficients when different parameterization is
> used
>
> Dear all,
>
> I am hoping someone could help me with this problem where different
> parameterization is used. I am meta-analyzing coefficients and
> standard errors from multiple studies where the raw data is not
> shared.
>
> Here is an illustrative example in R for one analyst:
>
> set.seed(1066)
> status <- rbinom( 1000, 1, 0.2 )
> males <- rbinom( 1000, 1, 0.6 )
> smoke <- rbinom( 1000, 1, 0.3 )
> age <- runif(1000, min=20, max=80)
>
> f1 <- glm( status ~ males*smoke + age, family="binomial" )
>
> Now, unfortunately some analysts coded sex as females instead of
> males.
> Using the same dataset, I get the following output with females:
>
> females <- 1 - males
> f2 <- glm( status ~ females*smoke + age, family="binomial" )
>
> My question is how to 'convert' from one set of coefficients to
> another.
>
> coef( summary( f1 ) )
> # Estimate Std. Error z value Pr(>|z|)
> # (Intercept) -1.520399871 0.284464584 -5.3447774 9.052825e-08
> # males 0.213851446 0.201717381 1.0601538 2.890746e-01
> # smoke -0.123103049 0.292346483 -0.4210861 6.736922e-01
> # age -0.001056007 0.004612947 -0.2289223 8.189293e-01
> # males:smoke 0.283775173 0.362821438 0.7821345 4.341355e-01
>
> coef(summary(f2))
> # Estimate Std. Error z value Pr(>|z|)
> # (Intercept) -1.306548425 0.262573162 -4.9759405 6.493160e-07
> # females -0.213851446 0.201717381 -1.0601538 2.890746e-01
> # smoke 0.160672124 0.214923130 0.7475795 4.547138e-01
> # age -0.001056007 0.004612947 -0.2289223 8.189293e-01
> # females:smoke -0.283775173 0.362821438 -0.7821345 4.341355e-01
>
>
> I have worked out algebrically (and numerically) the following:
>
> Beta(females) = -Beta(males)
> Var(females) = Var(males)
>
> Beta(females:smoke) = -Beta(males:smoke)
> Var(females:smoke) = Var(males:smoke)
>
> Beta(smoke | fit1) = Beta(smoke | fit2) + Beta(females:smoke)
> = 0.160672124 -0.283775173
> = -0.1231030
>
> But I am really struggling on defining the relationship between
> Var(smoke | fit1) and Var(smoke | fit2) ? I tried but ended up with a
> covariance term which I could not solve.
>
> Any suggestions is much appreciated. Many thanks in advance.
>
> Regards, Adai
>
> You may leave the list at any time by sending the command
>
> SIGNOFF allstat
>
> to [log in to unmask], leaving the subject line blank.
>
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
|