Announcement

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

  • r422 error

    Hi there,

    This is my first post so apologies in advance for any mistakes.

    I have looked at similar posts but have not been able to pin point the source for my error.

    I am using Stata version 16. My model contains one within-subjects variable Attractiveness with three levels and two between subject variables blocktype2 and Variety and both have two levels. I am conducting a repeated measures ANOVA but am repeatedly getting the r(422) error: could not determine between-subject basic unit; use bseunit() option.

    Variations of codes that I have typed are:
    anova Attractiveness Participant2 blocktype2/blocktype2|Participant2 Variety/Variety|Participant2 blocktype2#Variety, repeated (blocktype2 Variety)
    anova Attractiveness Participant2 blocktype2/blocktype2|Participant2 Variety/Variety|Participant2 blocktype2#Variety, repeated (blocktype2 Variety) bse(Participant2)
    anova Attractiveness Participant2 blocktype2/blocktype2|Participant2 Variety/Variety|Participant2 blocktype2#Variety, repeated (blocktype2 Variety) bse(Participant2) bseunit()


    I would like to know what is leading to this error and a solution to resolve this issue. Any help would be much appreciated.

    Thank you in advance!

    My data is in the long format:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str17 Participant byte ratings str29 Demographics int Age str7 blocktype byte Variety double Attractiveness byte(dummy1 dummy2) long(blocktype2 Participant2)
    "60619" 1 "Female"                        28 "random"  20      72.4903053112 0 1 2 19
    "60619" 2 "Female"                        28 "random"  20  65.62005032020001 0 1 2 19
    "60619" 3 "Female"                        28 "random"  20  63.51974094099999 0 1 2 19
    "60626" 1 "Male"                          24 "random"   4  26.78267361062001 0 1 2 20
    "60626" 2 "Male"                          24 "random"   4 28.806597222519983 0 1 2 20
    "60626" 3 "Male"                          24 "random"   4 27.411744791900002 0 1 2 20
    "60633" 1 "Gender Variant/Non-conforming" 21 "blocked" 20  33.02293272779999 1 0 1 21
    "60633" 2 "Gender Variant/Non-conforming" 21 "blocked" 20 28.179846475199998 1 0 1 21
    "60633" 3 "Gender Variant/Non-conforming" 21 "blocked" 20 34.900777204360004 1 0 1 21
    "60637" 1 "Female"                        19 "blocked" 20 31.227196181199997 1 0 1 22
    "60637" 2 "Female"                        19 "blocked" 20     33.18314236096 1 0 1 22
    "60637" 3 "Female"                        19 "blocked" 20 28.806883680580015 1 0 1 22
    "60684" 1 "Female"                        33 "blocked"  4 30.697777777720002 1 0 1 23
    "60684" 2 "Female"                        33 "blocked"  4 31.802222222000005 1 0 1 23
    "60684" 3 "Female"                        33 "blocked"  4 29.126666666940004 1 0 1 23
    "60724" 1 "Female"                        45 "random"  20  47.65555877619999 0 1 2 24
    "60724" 2 "Female"                        45 "random"  20 47.368521118200036 0 1 2 24
    "60724" 3 "Female"                        45 "random"  20 48.320372857200006 0 1 2 24
    "60730" 1 "Male"                          20 "blocked"  4 46.045703125399996 1 0 1 25
    "60730" 2 "Male"                          20 "blocked"  4      44.6938715276 1 0 1 25
    "60730" 3 "Male"                          20 "blocked"  4      47.7580468748 1 0 1 25
    "60745" 1 "Female"                        36 "blocked"  4 55.974074073400004 1 0 1 26
    "60745" 2 "Female"                        36 "blocked"  4      52.1962962958 1 0 1 26
    "60745" 3 "Female"                        36 "blocked"  4  54.04074074037998 1 0 1 26
    "60746" 1 "Female"                        22 "blocked" 20            63.7825 1 0 1 27
    "60746" 2 "Female"                        22 "blocked" 20            26.2525 1 0 1 27
    "60746" 3 "Female"                        22 "blocked" 20            37.6325 1 0 1 27
    "60754" 1 "Female"                        55 "blocked"  4      57.4041552736 1 0 1 28
    "60754" 2 "Female"                        55 "blocked"  4 56.135062662399996 1 0 1 28
    "60754" 3 "Female"                        55 "blocked"  4 61.641201035799995 1 0 1 28
    "60757" 1 "Male"                          29 "random"  20      72.7155555554 0 1 2 29
    "60757" 2 "Male"                          29 "random"  20  74.85555555539997 0 1 2 29
    "60757" 3 "Male"                          29 "random"  20  74.35777777799998 0 1 2 29
    "60768" 1 "Female"                        41 "random"   4 45.598958334059986 0 1 2 30
    "60768" 2 "Female"                        41 "random"   4      42.9791666664 0 1 2 30
    "60768" 3 "Female"                        41 "random"   4  42.58854166605999 0 1 2 30
    "60770" 1 "Male"                          33 "blocked" 20      69.9056199324 1 0 1 31
    "60770" 2 "Male"                          33 "blocked" 20      69.2090426722 1 0 1 31
    "60770" 3 "Male"                          33 "blocked" 20  69.81655217500001 1 0 1 31
    "60774" 1 "Female"                        34 "random"  20       36.730080227 0 1 2 32
    "60774" 2 "Female"                        34 "random"  20 37.412981771199995 0 1 2 32
    "60774" 3 "Female"                        34 "random"  20  36.29179836670001 0 1 2 32
    "60775" 1 "Female"                        42 "random"   4  57.95185185180002 0 1 2 33
    "60775" 2 "Female"                        42 "random"   4 57.416666666599994 0 1 2 33
    "60775" 3 "Female"                        42 "random"   4       57.909259259 0 1 2 33
    "60789" 1 "Female"                        44 "random"   4 27.372223748260012 0 1 2 34
    "60789" 2 "Female"                        44 "random"   4 30.201853603379995 0 1 2 34
    "60789" 3 "Female"                        44 "random"   4 26.355557165480004 0 1 2 34
    "60790" 1 "Male"                          47 "random"  20 25.222222222799996 0 1 2 35
    "60790" 2 "Male"                          47 "random"  20      23.6111111114 0 1 2 35
    "60790" 3 "Male"                          47 "random"  20 24.790740741000004 0 1 2 35
    "60791" 1 "Male"                          19 "blocked"  4  47.12407571300003 1 0 1 36
    "60791" 2 "Male"                          19 "blocked"  4      47.7981493914 1 0 1 36
    "60791" 3 "Male"                          19 "blocked"  4 48.268520637599984 1 0 1 36
    "60793" 1 "Female"                        21 "blocked" 20 38.839999999880014 1 0 1 37
    "60793" 2 "Female"                        21 "blocked" 20  35.77777777731999 1 0 1 37
    "60793" 3 "Female"                        21 "blocked" 20  44.64000000009998 1 0 1 37
    "60797" 1 "Male"                          21 "blocked" 20  57.90000000020001 1 0 1 38
    "60797" 2 "Male"                          21 "blocked" 20  56.78518518580001 1 0 1 38
    "60797" 3 "Male"                          21 "blocked" 20  56.85740740679999 1 0 1 38
    "60805" 1 "Female"                        34 "random"  20  32.89555555619998 0 1 2 39
    "60805" 2 "Female"                        34 "random"  20  43.00222222239999 0 1 2 39
    "60805" 3 "Female"                        34 "random"  20     26.67777777844 0 1 2 39
    "60818" 1 "Female"                        27 "blocked" 20 36.966666666900004 1 0 1 40
    "60818" 2 "Female"                        27 "blocked" 20     34.51555555556 1 0 1 40
    "60818" 3 "Female"                        27 "blocked" 20  32.48888888845999 1 0 1 40
    "60833" 1 "Female"                        39 "random"  20      47.7942708338 0 1 2 41
    "60833" 2 "Female"                        39 "random"  20  48.57812500039999 0 1 2 41
    "60833" 3 "Female"                        39 "random"  20       48.229166667 0 1 2 41
    "60844" 1 "Female"                        29 "random"  20  5.914814814939998 0 1 2 42
    "60844" 2 "Female"                        29 "random"  20  6.177777777959998 0 1 2 42
    "60844" 3 "Female"                        29 "random"  20 5.5851851852599985 0 1 2 42
    "60845" 1 "Female"                        22 "blocked" 20 28.840741899419985 1 0 1 43
    "60845" 2 "Female"                        22 "blocked" 20 24.598149617639987 1 0 1 43
    "60845" 3 "Female"                        22 "blocked" 20  23.92222391779999 1 0 1 43
    "60852" 1 "Female"                        43 "random"   4      59.4185185184 0 1 2 44
    "60852" 2 "Female"                        43 "random"   4  58.29999999940001 0 1 2 44
    "60852" 3 "Female"                        43 "random"   4  58.16481481560001 0 1 2 44
    "60860" 1 "Male"                          23 "random"  20 54.694063927080016 0 1 2 45
    "60860" 2 "Male"                          23 "random"  20 47.242187499719996 0 1 2 45
    "60860" 3 "Male"                          23 "random"  20     40.58143074572 0 1 2 45
    "60864" 1 "Male"                          22 "blocked" 20     10.92777831526 1 0 1 46
    "60864" 2 "Male"                          22 "blocked" 20  9.438277289099998 1 0 1 46
    "60864" 3 "Male"                          22 "blocked" 20  7.912294723680004 1 0 1 46
    "60877" 1 "Female"                        18 "blocked" 20            64.8825 1 0 1 47
    "60877" 2 "Female"                        18 "blocked" 20            71.6875 1 0 1 47
    "60877" 3 "Female"                        18 "blocked" 20              59.51 1 0 1 47
    "60878" 1 "Female"                        53 "random"  20     34.94009548594 0 1 2 48
    "60878" 2 "Female"                        53 "random"  20     33.09864583286 0 1 2 48
    "60878" 3 "Female"                        53 "random"  20     32.45860243066 0 1 2 48
    "60888" 1 "Female"                        18 "random"  20        34.87109375 0 1 2 49
    "60888" 2 "Female"                        18 "random"  20         33.6171875 0 1 2 49
    "60888" 3 "Female"                        18 "random"  20       31.025390625 0 1 2 49
    "60896" 1 "Female"                        24 "blocked"  4      43.7439515868 1 0 1 50
    "60896" 2 "Female"                        24 "blocked"  4       44.291960884 1 0 1 50
    "60896" 3 "Female"                        24 "blocked"  4 40.646371810399984 1 0 1 50
    "60908" 1 "Female"                        21 "blocked" 20  49.97222468059997 1 0 1 51
    "60908" 2 "Female"                        21 "blocked" 20  49.37963222920003 1 0 1 51
    "60908" 3 "Female"                        21 "blocked" 20  50.20740983779999 1 0 1 51
    "60912" 1 "Female"                        21 "random"   4       5.3633620196 0 1 2 52
    end
    label values blocktype2 blocktype2
    label def blocktype2 1 "blocked", modify
    label def blocktype2 2 "random", modify
    label values Participant2 Participant2
    label def Participant2 19 "60619", modify
    label def Participant2 20 "60626", modify
    label def Participant2 21 "60633", modify
    label def Participant2 22 "60637", modify
    label def Participant2 23 "60684", modify
    label def Participant2 24 "60724", modify
    label def Participant2 25 "60730", modify
    label def Participant2 26 "60745", modify
    label def Participant2 27 "60746", modify
    label def Participant2 28 "60754", modify
    label def Participant2 29 "60757", modify
    label def Participant2 30 "60768", modify
    label def Participant2 31 "60770", modify
    label def Participant2 32 "60774", modify
    label def Participant2 33 "60775", modify
    label def Participant2 34 "60789", modify
    label def Participant2 35 "60790", modify
    label def Participant2 36 "60791", modify
    label def Participant2 37 "60793", modify
    label def Participant2 38 "60797", modify
    label def Participant2 39 "60805", modify
    label def Participant2 40 "60818", modify
    label def Participant2 41 "60833", modify
    label def Participant2 42 "60844", modify
    label def Participant2 43 "60845", modify
    label def Participant2 44 "60852", modify
    label def Participant2 45 "60860", modify
    label def Participant2 46 "60864", modify
    label def Participant2 47 "60877", modify
    label def Participant2 48 "60878", modify
    label def Participant2 49 "60888", modify
    label def Participant2 50 "60896", modify
    label def Participant2 51 "60908", modify
    label def Participant2 52 "60912", modify


  • #2
    Hey welcome to Statalist. In the future, please put your code right in the "code" box too, it'll help us read the code more clearly. Does this page assist you in any way?

    Comment


    • #3
      Hi Jared,

      Thank you for the prompt reply. I will keep in mind to put the code in the code box.

      I had a look at the page that you linked but my issue could not be resolved. My data is in the long format and I have double checked the error terms in my code as per the suggestions on the page. Accordingly, the code should be:

      Code:
      anova Attractiveness Participant2 blocktype2/blocktype2|Participant2 Variety/Variety|Participant2 blocktype2##Variety, repeated (blocktype2 Variety)
      However, this keeps leading to the same error. The error also persists if I remove one variable:

      Code:
      anova Attractiveness Participant2 blocktype2/blocktype2|Participant2, repeated (blocktype2)
      I am unsure how to resolve this.

      Ishi

      Comment

      Working...
      X