Biostat 656: Lab 3



Biostat 656: Lab 3

Purpose:

1) Learn linear regression and logistic regression in WinBUGS and Stata

2) Compare results from WinBUGS and Stata

Linear Regression

Often we want to estimate the relationship between a continuous outcome and several variables. Let’s revisit the Rats data. Before we get fancy with the growth curve modeling, let’s see what happens when we treat each observation as independent. That is, we don’t account for the fact that the same 30 rats are measured at each time. Compare this model with that on homework 1:

model

{

for( i in 1 : N ) {

for( j in 1 : T ) {

Y[i , j] ~ dnorm(mu[i , j],tau.c)

mu[i , j] |z| [95% Conf. Interval]

-------------+----------------------------------------------------------------

x1 | .0969904 .2780422 0.35 0.727 -.4479624 .6419432

x2 | 1.337043 .2369396 5.64 0.000 .8726499 1.801436

x1x2 | -.81046 .3851746 -2.10 0.035 -1.565388 -.0555316

_cons | -.5484332 .1665951 -3.29 0.001 -.8749536 -.2219129

-------------+----------------------------------------------------------------

/lnsig2u | -2.885798 .9316616 -4.711821 -1.059775

-------------+----------------------------------------------------------------

sigma_u | .2362419 .1100487 .0948071 .5886711

rho | .0528601 .0466445 .0089083 .2573524

------------------------------------------------------------------------------

Likelihood ratio test of rho=0: chibar2(01) = 2.36 Prob >= chibar2 = 0.062

Notice that the parameter estimates are slightly different, depending on the inclusion of a random effect. Unlike normal data, the variance of binomial data depends on the mean. Therefore, changing the variance structure changes parameter estimates as well.

Stay tuned for lab 4 when we learn about random slopes! In lab 5, we’ll learn some general syntax for these models.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download