'SAS How to conduct paired t-test on off diagonal cells (proc surveymeans)

How to conduct paired t-test on off diagonal cells (proc surveymeans) Posted 45 seconds ago (3 views)

Hi,

I'm trying to compare same users' response in two separate years. There are many ways to respond.

enter image description here

Letter A to D are the ways to respond. Now, I need to conduct a paired t test to assess the impact of ways to respond on response status in between years (2019 vs 2020). To do that with proc surveymeans (I have replicate weights) I will need to expand into variables with binary output for each possible combinations

Respond = 0, no_response = 1

Such that:

enter image description here

My proc surveymeans will be:

ods graphics off;
  proc surveymeans data = df
  varmethod = jackknife mean var std stderr nobs sum all alpha=.1
    ;
    var Diff_A_19_20 Diff_A_20_19 Diff_B_19_20 Diff_B_20_19 .....;
    weight ctbw0;
    repweights ctbw1 - ctbw80 / JKCOEFS = 0.05;
;
run;
ods output close;

Is there a simpler way to conduct paired t-test in this scenario? There will be too many difference variables created because of the combinations.

Maybe I'm just not thinking on the right track.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source