Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how can i perform two group ttest with covariate

    i am performing two group t test of the size of a brain structure. however, the size of the structure is affected by age and total brain volume. i used anova brainstructure group c.age c.tbv. during the result reporting meeting, one superver teacher suggested i should perform t test with covariate. with simple t test. that is impossible. i think glm can. but i don't know how to do that. can anyone help me with this?
    i also find the content "Another example of why we should ditch the old terminology and just use general linear models! Forget t tests, ANOVA, ANCOVA, and regression. GLM!". so i am quite motivated to learn glm, though i wasn't taught to do it in school, let alone with stata. i learned stata by myself. so my knowlege about stata is not completely.

  • #2
    first, convince yourself that a t-test and a regression are the same thing:
    Code:
    sys use auto
    ttest mpg, by(foreign)
    regress mpg i.foreign
    after comparing those results (maybe using your own data), you can now add a covariate to your regression

    note that I have no idea whether this is what your supervisor means as I have never heard the language used

    note that "glm" means different things to different people; some people use it for "general linear model" (basically linear regression and anova) while others, including StataCorp use it for "generalized linear model"; see
    Code:
    help glm

    Comment


    • #3
      Mr Goldstein:
      thank you very much. your code is amazing. the significance with ttest is the same with regress. The concept of glm within my team means 'general linear model'. For we are using matlab based statistical parametric mapping software in neuroimaging, general linear model is quite familiar to us, though we don't understand the process that well. we are following the mannuals, lectures and published articles. with spm, one sample t test, two sample test, paired test, anova and regression are all performed with build-in general linear model of the software package(https://www.fil.ion.ucl.ac.uk/spm/). howere i got the region of interest with the decoding box package, the values have to be extracted and analised with third party software. i having been using stata for a while. if i can implement glm in my analysis, it can be a bridge between the difference. i will read glm help carefully.

      Comment

      Working...
      X