cregg icon indicating copy to clipboard operation
cregg copied to clipboard

Formally test differences in Marginal Means

Open Ales-G opened this issue 9 months ago • 0 comments

Dear Thomas, thank you for developing this amazing package. It is really amazing and a true asset for practice oriented scholars.

I apologies if this is a trivial question, but do you have any suggestions on how to test if marginal means are statistically different from one another? Take the following example. Is there a way to formally test if ChosenImmigrant is statistically different by gender? Should I use a simple t.test?

> data(immigration)
> mm(immigration, ChosenImmigrant ~ Gender + Education + LanguageSkills,
+    id = ~ CaseID, h0 = 0.5)
           outcome statistic                feature                    level  estimate   std.error          z            p     lower     upper
1  ChosenImmigrant        mm                 Gender                   Female 0.5117812 0.004176882   2.820574 4.793778e-03 0.5035947 0.5199677
2  ChosenImmigrant        mm                 Gender                     Male 0.4877013 0.004353571  -2.824964 4.728592e-03 0.4791685 0.4962342
3  ChosenImmigrant        mm Educational Attainment                No Formal 0.3895112 0.010396937 -10.627053 2.230500e-26 0.3691336 0.4098888
4  ChosenImmigrant        mm Educational Attainment                4th Grade 0.4222002 0.010291045  -7.559951 4.032206e-14 0.4020301 0.4423703
5  ChosenImmigrant        mm Educational Attainment                8th Grade 0.4444444 0.010183074  -5.455676 4.878681e-08 0.4244860 0.4644029
6  ChosenImmigrant        mm Educational Attainment              High School 0.5075226 0.010189329   0.738279 4.603449e-01 0.4875518 0.5274933
7  ChosenImmigrant        mm Educational Attainment         Two-Year College 0.5655860 0.010227744   6.412561 1.430949e-10 0.5455400 0.5856320
8  ChosenImmigrant        mm Educational Attainment           College Degree 0.5888945 0.010268403   8.657096 4.839344e-18 0.5687688 0.6090202
9  ChosenImmigrant        mm Educational Attainment          Graduate Degree 0.5812686 0.010393398   7.819251 5.313867e-15 0.5608979 0.6016393
10 ChosenImmigrant        mm        Language Skills           Fluent English 0.5875280 0.007305481  11.981136 4.461689e-33 0.5732095 0.6018464
11 ChosenImmigrant        mm        Language Skills           Broken English 0.5261628 0.007490787   3.492662 4.782307e-04 0.5114811 0.5408445
12 ChosenImmigrant        mm        Language Skills Tried English but Unable 0.4592973 0.007417263  -5.487558 4.075292e-08 0.4447598 0.4738349
13 ChosenImmigrant        mm        Language Skills         Used Interpreter 0.4243392 0.007564513 -10.002066 1.492498e-23 0.4095131 0.4391654

thanks in advance for your support

Best

Ales-G avatar Jul 07 '25 08:07 Ales-G