Just adding to Bendix' suggestion to use relevel(), here's a short example
script:


## Set seed for random number generation
set.seed(100)

## Create random example data
genotype <- sample(c('gg','gc','cc'),1000,replace=T)
disease <- sample(c(0,1), 1000, replace=T)

## Coerce genotype to factor
genotype <- as.factor(genotype)

## Note initial order of genotype
levels(genotype)
glm1 <- glm(disease~genotype, family=binomial())
summary(glm1)

## Reorder genotype factor, setting gg as reference
genotype <- relevel(genotype, 'gg')

## Note subsequent order
levels(genotype)
glm2 <- glm(disease~genotype, family=binomial())
summary(glm2)



Cheers,
Jeremy

Jeremy Hetzel
Boston University


2010/10/28 Екатерина Кудрявцева <kudryavtseva_kathrin@ngs.ru>

> To someone who could help me:
>
> I am a PhD student, working in the Novosibirsk University, Russia. I
> am now using glm() function to do logistic regression analysis.
> I cannot understand how the chosen reference group. For example, for the
> three genotypes of GG, GC, CC I want to be risk assessed in relation to
> the genotype CC, but the program selects the genotype GG. How do I
> change the reference group?
>
>
> Thanks for your time.
> Best wishes,
> Ekaterina Kudryavtseva
> PhD student,
> Department of Molecular Biology
> Novosibirsk University
> Tel: +7-923-185-82-47
>
> _______________________________________________
> R-sig-Epi@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-epi
>

	[[alternative HTML version deleted]]

