I have sale data which is not in normal distribution, so I have to do “proc genmod” with dist=gamma link=log. Also, I have to calculate the difference of mean between pre-study and during-study (variable of “time_period”) by treatment and control (variable of “hrs2_group”) group. However, when I exponentiated the estimate of the difference, the code does not work (in red highlighted). Any help is very appreciated. Thank you so much.
proc genmod data=bread_wheat_week;
ods output GEEEmpPEst=gee_ests_avgMVT
Estimates=mean_ests_avgMVT
Contrasts=contrasts_avgMVT;
class storeid operator time_period(param=ref ref= "Pre-study")
hrs2_group(param=ref ref="Control");
model total_mvt = time_period week hrs2_group time_period*hrs2_group week*hrs2_group week*hrs2_group*operator / dist=gamma link=log type3;
repeated subject=storeid / type=Exch ;
estimate "Control_Pre" intercept 1 week 65 / exp;
estimate "Control_During" intercept 1 week 65 time_period 1 / exp;
estimate "Intervention_Pre" intercept 1 week 65 hrs2_group 1 week*hrs2_group 65/ exp;
estimate "Intervention_During" intercept 1 week 65 hrs2_group 1 time_period 1 week*hrs2_group 65 time_period*hrs2_group 1/ exp;
estimate "Diff_Int" time_period 1 time_period*hrs2_group 1 / exp;
estimate "Diff_control" time_period 1 / exp;
estimate "Diff in diff" time_period*hrs2_group 1 / exp;
contrast "Int vs Cont: Pre" hrs2_group 1 week*hrs2_group 65/ wald;
contrast "Int vs Cont: During" hrs2_group 1 time_period*hrs2_group 1 week*hrs2_group 65 / wald;
contrast "During vs Pre: Control" time_period 1 / wald;
contrast "During vs Pre: Intervention" time_period 1 time_period*hrs2_group 1 / wald;
run;
data WORK.BREAD_WHEAT_WEEK;
infile datalines dsd truncover;
input type:$12. storeid:$4. category:$9. intervention_type:$10. operator:$16. hrs2_group:$12. hrs2_pair:$4. week:32. total_mvt:32. time_period:TIMEPER. week_after:32.;
format time_period TIMEPER.;
label type="type" storeid="storeid" category="category" intervention_type="intervention_type" operator="operator" hrs2_group="hrs2_group" hrs2_pair="hrs2_pair";
datalines;
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 1 3168 Pre-study -51
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 2 3816 Pre-study -50
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 3 3000 Pre-study -49
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 4 3672 Pre-study -48
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 5 3168 Pre-study -47
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 6 4352 Pre-study -46
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 7 3656 Pre-study -45
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 8 2856 Pre-study -44
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 9 4008 Pre-study -43
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 10 3456 Pre-study -42
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 11 3432 Pre-study -41
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 12 3536 Pre-study -40
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 13 2536 Pre-study -39
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 14 3496 Pre-study -38
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 15 4368 Pre-study -37
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 16 2976 Pre-study -36
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 17 3256 Pre-study -35
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 18 3936 Pre-study -34
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 19 3144 Pre-study -33
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 20 3056 Pre-study -32
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 21 3592 Pre-study -31
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 22 2928 Pre-study -30
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 23 2552 Pre-study -29
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 24 3000 Pre-study -28
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 25 2656 Pre-study -27
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 26 3192 Pre-study -26
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 27 3336 Pre-study -25
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 28 3360 Pre-study -24
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 29 2880 Pre-study -23
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 30 3504 Pre-study -22
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 31 3048 Pre-study -21
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 32 2856 Pre-study -20
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 33 4144 Pre-study -19
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 34 3184 Pre-study -18
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 35 2584 Pre-study -17
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 36 3768 Pre-study -16
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 37 2848 Pre-study -15
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 38 2264 Pre-study -14
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 39 4120 Pre-study -13
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 40 3040 Pre-study -12
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 41 2936 Pre-study -11
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 42 3352 Pre-study -10
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 43 2480 Pre-study -9
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 44 2952 Pre-study -8
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 45 3024 Pre-study -7
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 46 3616 Pre-study -6
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 47 2600 Pre-study -5
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 48 3360 Pre-study -4
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 49 2952 Pre-study -3
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 50 3280 Pre-study -2
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 51 2936 Pre-study -1
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 52 3376 Pre-study 0
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 53 3096 During-study 1
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 54 2464 During-study 2
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 55 4352 During-study 3
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 56 2688 During-study 4
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 57 2688 During-study 5
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 58 4192 During-study 6
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 59 2768 During-study 7
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 60 2520 During-study 8
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 61 3376 During-study 9
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 62 3440 During-study 10
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 63 2432 During-study 11
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 64 4024 During-study 12
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 65 2792 During-study 13
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 66 3192 During-study 14
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 67 3352 During-study 15
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 68 2200 During-study 16
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 69 2904 During-study 17
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 70 3200 During-study 18
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 71 2240 During-study 19
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 72 2824 During-study 20
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 73 3416 During-study 21
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 74 3000 During-study 22
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 75 2728 During-study 23
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 76 4168 During-study 24
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 77 2744 During-study 25
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 78 2336 During-study 26
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 79 5152 During-study 27
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 80 2760 During-study 28
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 81 2240 During-study 29
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 82 4952 During-study 30
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 83 2400 During-study 31
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 84 2680 During-study 32
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 85 3512 During-study 33
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 86 2528 During-study 34
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 87 3224 During-study 35
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 88 4528 During-study 36
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 89 2392 During-study 37
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 90 2440 During-study 38
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 91 5144 During-study 39
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 92 2544 During-study 40
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 93 2552 During-study 41
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 94 5288 During-study 42
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 95 2408 During-study 43
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 96 2512 During-study 44
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 97 4304 During-study 45
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 98 2440 During-study 46
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 99 2352 During-study 47
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 100 5720 During-study 48
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 101 2448 During-study 49
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 102 2448 During-study 50
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 103 2952 During-study 51
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 104 2576 During-study 52
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 105 3048 During-study 53
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 106 4496 During-study 54
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 107 2312 During-study 55
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 108 5312 During-study 56
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 109 2768 During-study 57
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 110 2696 During-study 58
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 111 2960 During-study 59
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 112 4280 During-study 60
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 113 3352 During-study 61
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 114 2464 During-study 62
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 115 5264 During-study 63
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 116 2352 During-study 64
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 117 2056 During-study 65
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 118 3416 During-study 66
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 119 2736 During-study 67
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 120 3064 During-study 68
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 121 4416 During-study 69
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 122 2488 During-study 70
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 123 2736 During-study 71
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 124 3256 During-study 72
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 125 2592 During-study 73
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 126 2872 During-study 74
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 127 3768 During-study 75
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 128 2784 During-study 76
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 129 3072 During-study 77
Wheat 1101 Bread Target McMenamin Family Intervention MC-1 130 3664 During-study 78
Wheat 1202 Bread Target McMenamin Family Control MC-1 1 2664 Pre-study -51
Wheat 1202 Bread Target McMenamin Family Control MC-1 2 3784 Pre-study -50
Wheat 1202 Bread Target McMenamin Family Control MC-1 3 3248 Pre-study -49
Wheat 1202 Bread Target McMenamin Family Control MC-1 4 2832 Pre-study -48
Wheat 1202 Bread Target McMenamin Family Control MC-1 5 2624 Pre-study -47
Wheat 1202 Bread Target McMenamin Family Control MC-1 6 3376 Pre-study -46
Wheat 1202 Bread Target McMenamin Family Control MC-1 7 2960 Pre-study -45
Wheat 1202 Bread Target McMenamin Family Control MC-1 8 2576 Pre-study -44
Wheat 1202 Bread Target McMenamin Family Control MC-1 9 3504 Pre-study -43
Wheat 1202 Bread Target McMenamin Family Control MC-1 10 2896 Pre-study -42
Wheat 1202 Bread Target McMenamin Family Control MC-1 11 3784 Pre-study -41
Wheat 1202 Bread Target McMenamin Family Control MC-1 12 2856 Pre-study -40
Wheat 1202 Bread Target McMenamin Family Control MC-1 13 2664 Pre-study -39
Wheat 1202 Bread Target McMenamin Family Control MC-1 14 3152 Pre-study -38
Wheat 1202 Bread Target McMenamin Family Control MC-1 15 2976 Pre-study -37
Wheat 1202 Bread Target McMenamin Family Control MC-1 16 2760 Pre-study -36
Wheat 1202 Bread Target McMenamin Family Control MC-1 17 2720 Pre-study -35
Wheat 1202 Bread Target McMenamin Family Control MC-1 18 3864 Pre-study -34
Wheat 1202 Bread Target McMenamin Family Control MC-1 19 2392 Pre-study -33
Wheat 1202 Bread Target McMenamin Family Control MC-1 20 2912 Pre-study -32
Wheat 1202 Bread Target McMenamin Family Control MC-1 21 3136 Pre-study -31
Wheat 1202 Bread Target McMenamin Family Control MC-1 22 2552 Pre-study -30
Wheat 1202 Bread Target McMenamin Family Control MC-1 23 3160 Pre-study -29
Wheat 1202 Bread Target McMenamin Family Control MC-1 24 2800 Pre-study -28
Wheat 1202 Bread Target McMenamin Family Control MC-1 25 2744 Pre-study -27
Wheat 1202 Bread Target McMenamin Family Control MC-1 26 3232 Pre-study -26
Wheat 1202 Bread Target McMenamin Family Control MC-1 27 3144 Pre-study -25
Wheat 1202 Bread Target McMenamin Family Control MC-1 28 2584 Pre-study -24
Wheat 1202 Bread Target McMenamin Family Control MC-1 29 2440 Pre-study -23
Wheat 1202 Bread Target McMenamin Family Control MC-1 30 3512 Pre-study -22
Wheat 1202 Bread Target McMenamin Family Control MC-1 31 2440 Pre-study -21
Wheat 1202 Bread Target McMenamin Family Control MC-1 32 2568 Pre-study -20
Wheat 1202 Bread Target McMenamin Family Control MC-1 33 2808 Pre-study -19
Wheat 1202 Bread Target McMenamin Family Control MC-1 34 3048 Pre-study -18
Wheat 1202 Bread Target McMenamin Family Control MC-1 35 2928 Pre-study -17
Wheat 1202 Bread Target McMenamin Family Control MC-1 36 3312 Pre-study -16
Wheat 1202 Bread Target McMenamin Family Control MC-1 37 2360 Pre-study -15
Wheat 1202 Bread Target McMenamin Family Control MC-1 38 2368 Pre-study -14
Wheat 1202 Bread Target McMenamin Family Control MC-1 39 3048 Pre-study -13
Wheat 1202 Bread Target McMenamin Family Control MC-1 40 2088 Pre-study -12
Wheat 1202 Bread Target McMenamin Family Control MC-1 41 2888 Pre-study -11
Wheat 1202 Bread Target McMenamin Family Control MC-1 42 3024 Pre-study -10
Wheat 1202 Bread Target McMenamin Family Control MC-1 43 2576 Pre-study -9
Wheat 1202 Bread Target McMenamin Family Control MC-1 44 2368 Pre-study -8
Wheat 1202 Bread Target McMenamin Family Control MC-1 45 3024 Pre-study -7
Wheat 1202 Bread Target McMenamin Family Control MC-1 46 2184 Pre-study -6
Wheat 1202 Bread Target McMenamin Family Control MC-1 47 2344 Pre-study -5
Wheat 1202 Bread Target McMenamin Family Control MC-1 48 2928 Pre-study -4
Wheat 1202 Bread Target McMenamin Family Control MC-1 49 1880 Pre-study -3
Wheat 1202 Bread Target McMenamin Family Control MC-1 50 2504 Pre-study -2
Wheat 1202 Bread Target McMenamin Family Control MC-1 51 2440 Pre-study -1
Wheat 1202 Bread Target McMenamin Family Control MC-1 52 2480 Pre-study 0
Wheat 1202 Bread Target McMenamin Family Control MC-1 53 2216 During-study 1
Wheat 1202 Bread Target McMenamin Family Control MC-1 54 1736 During-study 2
Wheat 1202 Bread Target McMenamin Family Control MC-1 55 4280 During-study 3
Wheat 1202 Bread Target McMenamin Family Control MC-1 56 1856 During-study 4
Wheat 1202 Bread Target McMenamin Family Control MC-1 57 1976 During-study 5
Wheat 1202 Bread Target McMenamin Family Control MC-1 58 3376 During-study 6
Wheat 1202 Bread Target McMenamin Family Control MC-1 59 1440 During-study 7
Wheat 1202 Bread Target McMenamin Family Control MC-1 60 2448 During-study 8
Wheat 1202 Bread Target McMenamin Family Control MC-1 61 3184 During-study 9
Wheat 1202 Bread Target McMenamin Family Control MC-1 62 1920 During-study 10
Wheat 1202 Bread Target McMenamin Family Control MC-1 63 2248 During-study 11
Wheat 1202 Bread Target McMenamin Family Control MC-1 64 3720 During-study 12
Wheat 1202 Bread Target McMenamin Family Control MC-1 65 2224 During-study 13
Wheat 1202 Bread Target McMenamin Family Control MC-1 66 1864 During-study 14
Wheat 1202 Bread Target McMenamin Family Control MC-1 67 2544 During-study 15
Wheat 1202 Bread Target McMenamin Family Control MC-1 68 1672 During-study 16
Wheat 1202 Bread Target McMenamin Family Control MC-1 69 2208 During-study 17
Wheat 1202 Bread Target McMenamin Family Control MC-1 70 2456 During-study 18
Wheat 1202 Bread Target McMenamin Family Control MC-1 71 2128 During-study 19
Wheat 1202 Bread Target McMenamin Family Control MC-1 72 2088 During-study 20
Wheat 1202 Bread Target McMenamin Family Control MC-1 73 2480 During-study 21
Wheat 1202 Bread Target McMenamin Family Control MC-1 74 2032 During-study 22
Wheat 1202 Bread Target McMenamin Family Control MC-1 75 1936 During-study 23
Wheat 1202 Bread Target McMenamin Family Control MC-1 76 3456 During-study 24
Wheat 1202 Bread Target McMenamin Family Control MC-1 77 2136 During-study 25
Wheat 1202 Bread Target McMenamin Family Control MC-1 78 2176 During-study 26
Wheat 1202 Bread Target McMenamin Family Control MC-1 79 3544 During-study 27
Wheat 1202 Bread Target McMenamin Family Control MC-1 80 1528 During-study 28
Wheat 1202 Bread Target McMenamin Family Control MC-1 81 2016 During-study 29
Wheat 1202 Bread Target McMenamin Family Control MC-1 82 3616 During-study 30
Wheat 1202 Bread Target McMenamin Family Control MC-1 83 1704 During-study 31
Wheat 1202 Bread Target McMenamin Family Control MC-1 84 2072 During-study 32
Wheat 1202 Bread Target McMenamin Family Control MC-1 85 3584 During-study 33
Wheat 1202 Bread Target McMenamin Family Control MC-1 86 2192 During-study 34
Wheat 1202 Bread Target McMenamin Family Control MC-1 87 2440 During-study 35
Wheat 1202 Bread Target McMenamin Family Control MC-1 88 3464 During-study 36
Wheat 1202 Bread Target McMenamin Family Control MC-1 89 1632 During-study 37
Wheat 1202 Bread Target McMenamin Family Control MC-1 90 2032 During-study 38
Wheat 1202 Bread Target McMenamin Family Control MC-1 91 4232 During-study 39
Wheat 1202 Bread Target McMenamin Family Control MC-1 92 1816 During-study 40
Wheat 1202 Bread Target McMenamin Family Control MC-1 93 2168 During-study 41
Wheat 1202 Bread Target McMenamin Family Control MC-1 94 4584 During-study 42
Wheat 1202 Bread Target McMenamin Family Control MC-1 95 1928 During-study 43
Wheat 1202 Bread Target McMenamin Family Control MC-1 96 2312 During-study 44
Wheat 1202 Bread Target McMenamin Family Control MC-1 97 3992 During-study 45
Wheat 1202 Bread Target McMenamin Family Control MC-1 98 1248 During-study 46
Wheat 1202 Bread Target McMenamin Family Control MC-1 99 960 During-study 47
Wheat 1202 Bread Target McMenamin Family Control MC-1 100 4152 During-study 48
Wheat 1202 Bread Target McMenamin Family Control MC-1 101 1928 During-study 49
Wheat 1202 Bread Target McMenamin Family Control MC-1 102 1952 During-study 50
Wheat 1202 Bread Target McMenamin Family Control MC-1 103 2960 During-study 51
Wheat 1202 Bread Target McMenamin Family Control MC-1 104 2072 During-study 52
Wheat 1202 Bread Target McMenamin Family Control MC-1 105 2048 During-study 53
Wheat 1202 Bread Target McMenamin Family Control MC-1 106 4568 During-study 54
Wheat 1202 Bread Target McMenamin Family Control MC-1 107 1808 During-study 55
Wheat 1202 Bread Target McMenamin Family Control MC-1 108 4568 During-study 56
Wheat 1202 Bread Target McMenamin Family Control MC-1 109 1992 During-study 57
Wheat 1202 Bread Target McMenamin Family Control MC-1 110 2000 During-study 58
Wheat 1202 Bread Target McMenamin Family Control MC-1 111 1856 During-study 59
Wheat 1202 Bread Target McMenamin Family Control MC-1 112 4440 During-study 60
Wheat 1202 Bread Target McMenamin Family Control MC-1 113 1408 During-study 61
Wheat 1202 Bread Target McMenamin Family Control MC-1 114 1672 During-study 62
Wheat 1202 Bread Target McMenamin Family Control MC-1 115 4696 During-study 63
Wheat 1202 Bread Target McMenamin Family Control MC-1 116 1168 During-study 64
Wheat 1202 Bread Target McMenamin Family Control MC-1 117 1600 During-study 65
Wheat 1202 Bread Target McMenamin Family Control MC-1 118 3920 During-study 66
Wheat 1202 Bread Target McMenamin Family Control MC-1 119 2064 During-study 67
Wheat 1202 Bread Target McMenamin Family Control MC-1 120 1488 During-study 68
Wheat 1202 Bread Target McMenamin Family Control MC-1 121 3408 During-study 69
Wheat 1202 Bread Target McMenamin Family Control MC-1 122 1752 During-study 70
Wheat 1202 Bread Target McMenamin Family Control MC-1 123 2032 During-study 71
Wheat 1202 Bread Target McMenamin Family Control MC-1 124 2560 During-study 72
Wheat 1202 Bread Target McMenamin Family Control MC-1 125 1800 During-study 73
Wheat 1202 Bread Target McMenamin Family Control MC-1 126 1816 During-study 74
Wheat 1202 Bread Target McMenamin Family Control MC-1 127 3232 During-study 75
Wheat 1202 Bread Target McMenamin Family Control MC-1 128 1600 During-study 76
Wheat 1202 Bread Target McMenamin Family Control MC-1 129 2128 During-study 77
Wheat 1202 Bread Target McMenamin Family Control MC-1 130 3256 During-study 78
;;;;
@PLK wrote:
However, when I exponentiated the estimate of the difference, the code does not work (in red highlighted).
estimate "Diff_Int" time_period 1 time_period*hrs2_group 1 / exp;
estimate "Diff_control" time_period 1 / exp;
estimate "Diff in diff" time_period*hrs2_group 1 / exp;
What about it doesn't work?
This statement is for exponentiating the mean of intervention group in during-study period:
estimate "Intervention_During" intercept 1 week 65 hrs2_group 1 time_period 1 week*hrs2_group 65 time_period*hrs2_group 1/ exp;
This statement is for exponentiating the mean of intervention group in pre-study period:
estimate "Intervention_Pre" intercept 1 week 65 hrs2_group 1 week*hrs2_group 65/ exp;
I would like to have the mean of the difference between these two group, but the code listed below doesn't work as it is not right in Math.
Difference = exp(B0 +B1) - exp(B0+B2)
the code listed below is exp (B1)- exp(B2)
estimate "Diff_Int" time_period 1 time_period*hrs2_group 1 / exp;
I am looking forward to some suggestion on the coding.
Thank you for paying attention and response.
As I think you are saying, algebraically, the difference
exp(B0 +B1) - exp(B0+B2) as computed by ESTIMATE
is not equal to exp( (B0+B1) - (B0+B2) ) = exp( B1 - B2 ) as computed by ESTIMATE
I'd suggest using ESTIMATE to compute (B1 - B2) and whatever interval you want (e.g., a CI or +/- SE), and then back-transforming the difference and the interval endpoints.
EDIT: Oops, my suggestion is wrong, and I've striked it out. My apologies. You could compute the point estimate for exp(B0+B1) - exp(B0+B2) by hand using output from the first two ESTIMATE statements.
I am not convinced that the ESTIMATE statements are correctly specified. The LSMESTIMATE statement is more foolproof than the ESTIMATE statement, and you might check into that. See CONTRAST and ESTIMATE Statements Made Easy: The LSMESTIMATE Statement. You can check your specifications using output from LSMEANS.
Also, your MODEL statement does not follow the hierarchical principle for interaction:
When interactions are included in the model, the main effects needs to be included in the model as well. The main effects needs to be included even if the individual variables are not significant in the model. https://datascientia.blog/2017/08/27/dss-p9-interactions/
For example, if you include "week*hrs2_group*operator" then you also include the 3 main effects and the 3 two-way interactions.
This rule should be followed most of the time; if you don't follow it, then you should know why you aren't.
Differences on the mean scale can be estimated using the NLMeans macro.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.