Email discussion lists for the UK Education and Research communities

BUGS@JISCMAIL.AC.UK

View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font
 LISTSERV Archives BUGS Home BUGS 2006

Options

Subject:

Dummy coding et al.

From:

Gregor Gorjanc <[log in to unmask]>

Reply-To:

Gregor Gorjanc <[log in to unmask]>

Date:

Thu, 23 Feb 2006 09:20:34 +0100

Content-Type:

text/plain

Parts/Attachments:

 text/plain (69 lines)
 ```Hello BUGS users! I am having a hard time with dummy coding and representation of results. This is rather basic, but I just can not find the solution anywhere. I hope someone can help me with this. Here is the model I would like to fit y_i ~ N(mu_i, sigma^2) mu_i = intercept + beta_j + gamma_k, where beta and gamma are two factors, each with say 3 levels. Now I write the following model, where I use "double indexing" feature and corner constraint i.e. "treatment contrast" for (i in 1:N) {   y[i] ~ dnorm(mu[i], tau2)   mu[i] <- alpha + beta[b[i]] + gamma[g[i]] } alpha ~ dunif(-100, 100) beta[1] <- 0 # corner constraint beta[2] ~ dunif(-100, 100) beta[3] ~ dunif(-100, 100) gamma[1] <- 0 # corner constraint gamma[2] ~ dunif(-100, 100) gamma[3] ~ dunif(-100, 100) After compiling and running I get the following coefficients in result alpha, beta[2], beta[3], gamma[2] and gamma[3] and if I am right the meaning of coefficients is alpha = intercept + beta[1] + gamma[1] beta[2] = alpha - beta[2] ... However, for presentation of results I would like to get "true" beta coefficients i.e. beta_j "marginal" to gamma_k - LSM (Least Square Means) in SAS parlance. How can I construct these quantities in BUGS? -- Lep pozdrav / With regards,     Gregor Gorjanc ---------------------------------------------------------------------- University of Ljubljana PhD student Biotechnical Faculty Zootechnical Department URI: http://www.bfro.uni-lj.si/MR/ggorjan Groblje 3 mail: gregor.gorjanc bfro.uni-lj.si SI-1230 Domzale tel: +386 (0)1 72 17 861 Slovenia, Europe fax: +386 (0)1 72 17 888 ---------------------------------------------------------------------- "One must learn by doing the thing; for though you think you know it,  you have no certainty until you try." Sophocles ~ 450 B.C. ---------------------------------------------------------------------- ------------------------------------------------------------------- This list is for discussion of modelling issues and the BUGS software. For help with crashes and error messages, first mail [log in to unmask] To mail the BUGS list, mail to [log in to unmask] Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html Please do not mail attachments to the list. To leave the BUGS list, send LEAVE BUGS to [log in to unmask] If this fails, mail [log in to unmask], NOT the whole list ```

RSS Feeds and Sharing

JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk