Announcement

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

  • Two-way repeated measures ANOVA, can't handle size of data? (maxvar too small, r (907) ; )

    Hello, I am trying to run a two-way repeated measures ANOVA but can't. I am not sure if it is a problem with the size or the data or how I set it up. I am not even sure if I could find what I want even with a one-way repeated ANOVA, but that's another story.

    My commands log is this:

    . clear

    . set maxvar 32767

    . import excel "C:\blablablablabla.xls", sheet("O3") cell
    > range(D2:I52191) firstrow

    . anova Q1 Date##Station, repeated(Q2 Q3 Q4)
    maxvar too small
    You have attempted to use an interaction with too many levels or attempted to fit a model with too many variables. You need
    to increase maxvar; it is currently 32767. Use set maxvar; see help maxvar.

    If you are using factor variables and included an interaction that has lots of missing cells, either increase maxvar or set
    emptycells drop to reduce the required matrix size; see help set emptycells.

    If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting in
    lots of categories. Use the c. operator on such variables.
    r(907);

    .
    As you can see I have the maxvar set on the maximum value before importing the file. Here is the form in which the data is in, in the excel file:

    Mean Daily Concentration Year Month Date Q1 Q2 Q3 Q4 Station
    8.541666667 1 1 01/01/2007 2 3 27.16667 2 1
    25.08333333 1 1 02/01/2007 16 27.83333 28 28.5 1
    22.58333333 1 1 03/01/2007 38.66667 19.5 27 5.166667 1
    10.70833333 1 1 04/01/2007 13.16667 9.166667 15.5 5 1
    6.541666667 1 1 05/01/2007 1.333333 3.333333 17.16667 4.333333 1
    15.375 1 1 06/01/2007 8.166667 18.83333 31.5 3 1
    10.08333333 1 1 07/01/2007 1.166667 6 31 2.166667 1
    6.833333333 1 1 08/01/2007 1.333333 3 20.5 2.5 1

    What I am trying to do is measure the impact time and location (columns ''Date'' and ''Station'')have on my concentration values, measured over 4 different 6-hour periods
    (Q1 - Q4). Have I set up the two-way repeated ANOVA correctly? If yes and it's a size data, is there any workaround I can do?

    Thanks

  • #2
    Welcome to the Stata Forum / Statalist.

    It seems the issue is not related to importing, but to the - anova - command.

    Please read the instructions of the Stata Manual concerning repeated-measures ANOVA. This is the best starting point.

    That being said, I just wish to underline that the data must be in long form so as to perform the estimation.

    You will most probably need to use the - reshape long - command.

    That also being said, the command in #1 tries to perform an interaction of a date variable with a categorical variable.

    To tackle both issues, please read about datetime operations and factor notation in Stata, respectively.

    Hopefully that helps.
    Last edited by Marcos Almeida; 21 Jan 2019, 05:26.
    Best regards,

    Marcos

    Comment


    • #3
      In addition to what Marcos has said, you might wish to consider using the mixed command to estimate your model. It is not clear from the image you included how many levels of time you have, but it looks like a lot. In that case, you might be better off treating time as a quantitative variable, with terms to account for non-linearity if necessary. This UCLA webpage will help get you started in that direction. Note that it uses xtmixed rather than mixed. From the help for xtmixed:


      Code:
          xtmixed has been renamed to mixed.  xtmixed continues to work but, as of Stata 13, is no
          longer an official part of Stata.  This is the original help file, which we will no
          longer update, so some links may no longer work.
      UCLA's "textbook examples" for Applied Longitudinal Data Analysis by Singer & Willett (2003) may also be helpful. It too uses xtmixed where nowadays one would use mixed.

      HTH.
      --
      Bruce Weaver
      Email: [email protected]
      Version: Stata/MP 18.5 (Windows)

      Comment


      • #4
        In addition to xtmixed, you can estimate an Anova with xtreg, fe or reghdfe (if more than one dimension).

        Comment

        Working...
        X