Announcement

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

  • Design of Experiment:

    Hello,

    My design of experiment is as follows:

    Click image for larger version

Name:	Doe1.png
Views:	1
Size:	5.0 KB
ID:	1291929


    Considering 2 between-the-subject factors with 2 levels each, I have designed 4 different experiments and have recruited 30 subjects for each experimental setup. I have collected 8 responses (within the subject factors) from each individual.

    (4 differnt experiments: hAhB hAlB lAhB lAlB, with 30 subjects each)

    I have arranged data in following format
    Click image for larger version

Name:	DOE.png
Views:	2
Size:	21.2 KB
ID:	1291928

    Now how should I do the analysis? I am unable to get any reference which deals with such kind of problem. I would be grateful if any of you can help me in this regards.
    What should be the Stata command for analysis?

    xtmixed Y A B || C: D: E:|| Subj Name: is not working on stata.
    Attached Files

  • #2
    In your data layout, most of the observations are not attributed to any particular subject. I assume you intend that, for example, observations 2 through 8 all refer to subject hAhB-01, who is named in observation 1, etc. Also, clearly what you are showing us is not a Stata data set because Sr No and Subj Name are both illegal as variable names due to embedded blanks. I'll start by assuming that you have actually imported this data into Stata and that your variables have been given legal names such as Sr_No and Subj_Name.

    Code:
    // IDENTIFY EVERY OBSERVATION WITH A SUBJECT
    sort Sr_No
    replace Subj_Name = Subj_Name[_n-1] if missing(Subj_Name)
    // AND CREATE A NUMERIC SUBJECT IDENTIFIER
    encode Subj_Name, gen(Subject)
    
    // MODEL THE RESULTS
    mixed Y i.A i.B i.C i.D i.E || Subject:

    Comment


    • #3
      Thank you very much for a quick reply.

      Originally posted by Clyde Schechter View Post
      In your data layout, ...................such as Sr_No and Subj_Name.
      Yes sir, you have understood my problem correctly .

      Code:
      // MODEL THE RESULTS
      mixed Y i.A i.B i.C i.D i.E || Subject:
      Isn't there any need to specify that A and B are between the subjects and C,D,E are within the subjects factors in above model?
      Or command mixed Y i.A i.B i.C i.D i.E || Subject: is is differentiating within and between the subjects automatically?

      Thank you once agian

      Comment


      • #4
        The data themselves identify the within and between effects: A and B will be constant for any given subject but differ across subjects, whereas C D and E will differ within subjects as well as across subjects. Nothing explicit needs to be said about this in the command.

        Comment


        • #5
          Thank you very much for clarification.

          I have a last doubt, I would be grateful if you could help me.

          If Y is an ordinal variable taking 3 values (Disagree, Neutral, Agree - encoded as 1,2,3), then how should I go about it?
          "xtmelogit " is not useful since I am having observations other than 0 and 1.

          Comment


          • #6
            You could look at -meologit- to do an ordinal logistic regression. Some people would also be comfortable considering this as a continuous variable anyway and sticking with -mixed-.

            Comment

            Working...
            X