BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AliRKM
Obsidian | Level 7

Hi there,

I would like to perform a t-test on survey data and found that the domain statement has a DIFF option.

 

This is the data:

data WORK.TTEST;
infile datalines dsd truncover;
input DUPERSID:$8. VARPSU:32. VARSTR:32. poolwt:32. subpop:32. adj_ERTEXPY1:32. adj_RXEXPY1:32. adj_RXEXPY2:32. adj_TOTEXPY1:32. adj_TOTEXPY2:32.;
label DUPERSID="PERSON ID (DUID + PID)" VARPSU="VARIANCE ESTIMATION PSU" VARSTR="VARIANCE ESTIMATION STRATUM";
datalines;
10001101 1 1021 6820.3638388 1 . 7.1330798479 2695 2735.026616 4948
10001102 1 1021 6011.4727588 1 . . 9 824.38022814 362
10001103 1 1021 6080.6644898 1 880.42585551 . 165 7433.6882129 1535
10001104 1 1021 6139.2404668 1 1529.5361217 2560.7756654 10 4996.2129278 995
10002101 1 1077 3125.6143298 0 . 2720.7604563 1676 25133.91635 208014
10002102 1 1077 3681.7596113 0 . . . . .
10004101 3 1089 2492.3878598 0 . . 75 213.99239544 1009
10005101 2 1012 2844.490106 0 . 252.7148289 128 1427.634981 277
10005102 2 1012 3681.681901 0 . 110.05323194 167 2888.8973384 3673
10005103 2 1012 3480.0634415 0 326.08365019 . 12 467.72623574 706
10006101 1 1003 15081.075204 0 . 23.437262357 342 23.437262357 31340
10008101 1 1142 5955.1487343 0 . 7.1330798479 . 7.1330798479 .
10008102 1 1142 7483.37747 0 . 2793.1102662 1593 3482.9809886 2128
10008104 1 1142 4737.750246 0 . 2186.7984791 1470 3677.6121673 3033
10008105 1 1142 5663.2273393 0 . 1514.2509506 1537 3877.338403 3226
10008106 1 1142 7438.6524568 0 . 1091.3612167 1471 1545.8403042 2843
10008107 1 1142 4986.8989575 0 . 8.1520912548 6 13350.068441 1739
10008108 1 1142 4864.6059188 0 . . . . .
10009101 1 1004 6625.7804373 1 . . 10 228.25855513 1630
10009102 1 1004 7024.5235785 1 . 13.247148289 40 2221.4448669 33548
10009103 1 1004 6407.0544698 1 . 631.78707224 604 3222.1140684 2247
10009104 1 1004 13623.937655 0 . . 480 . 2046
10010101 1 1008 27326.603299 0 . 15.285171103 24 886.53992395 562
10010102 1 1008 26289.643731 0 . . . 619.55893536 140
10014101 2 1030 6102.345339 0 . 443.26996198 109 4156.5475285 2000
10016101 1 1144 3909.2115073 0 . . 12 . 12
10017101 2 1003 5244.852484 0 1183.0722433 15.285171103 . 1486.7376426 .
10017102 2 1003 7466.6795125 0 . . . 270.03802281 .
10019102 3 1124 5606.137352 0 . 5962.2357414 4502 16094.26616 31962
10021101 1 1130 4419.1832208 0 . . . . .
10022101 1 1018 2635.7591798 0 . 36.684410646 118 358.69201521 1349
10022102 1 1018 2953.8852153 0 . . . . 110
10022103 1 1018 2090.6765608 0 . 10.190114068 9 249.65779468 9
10023101 3 1023 2279.8954978 0 . 648.09125475 1130 1380.7604563 2432
10023102 3 1023 3654.2519563 1 . 262.90494297 67 965.00380228 1972
10024101 2 1059 2280.0660103 1 . 2067.5741445 3116 2159.2851711 3201
10024102 2 1059 2278.1422513 1 . . 3 . 7199
10024103 2 1059 1918.5318633 1 . . . . .
10024104 2 1059 1486.43269 01. . 29 445.30798479 7841
10024105 2 1059 1396.701735 0 . . . . 123
10024106 2 1059 1608.6954495 0 . . . 418.81368821 1367
10025101 1 1122 10648.338945 0 . 502.37262357 417 1501.0038023 1537
10025102 1 1122 9504.141299 0 . 394.35741445 2784 2268.3193916 2834
10025103 1 1122 12284.554372 0 . 1752.6996198 6975 2208.1977186 7508
3 The SAS System 10:27 Friday, April 24, 2020

10027101 1 1084 9151.1762425 0 . 4292.0760456 1332 10701.657795 11221
10027102 1 1084 9895.8191088 0 645.03422053 7972.7452471 7244 20407.741445 24101
10028101 1 1118 2733.7887845 0 . 6.1140684411 . 4805.6577947 8189
10029101 3 1124 5772.2379498 0 1505.0798479 2660.6387833 704 7164.6692015 11427
10031101 1 1013 5267.2207123 0 . 1769.0038023 4424 1769.0038023 12264
10031102 1 1013 3722.491092 0 . 325.06463878 667 9702.0076046 9481
;;;;

Is it possible that this option is not available on SAS Enterprise Guide (V7.15 HF8) as I keep getting an error message?

 

ERROR 79-322: Expecting a DFADJ.
ERROR 202-322: The option or parameter is not recognized and will be ignored.

proc surveymeans data=meps.analysis;
var  adj_RXEXPY1 adj_RXEXPY2 adj_TOTEXPY1 adj_TOTEXPY2;
 stratum varstr;
cluster varpsu;
weight poolwt;
domain subpop/diff;
run;

Many thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The error message you are showing makes me think that you may not have one of the versions of SAS/Stat installed that has the DIFF option.

Run this code:


proc product_status; run;

Find the line in the log that looks something like:

For SAS/STAT ...
   Custom version information: 14.2

If the version is 14.1 or less then the DIFF option is not available for Surveymeans domain statement. In 14.1 the only option available for Domain is DFADJ. Which adjusts degrees of freedom for strata with missing domain variable values.

View solution in original post

4 REPLIES 4
ballardw
Super User

When posting errors it is best to copy the entire proc or data step code from the log along with the error message. Many of the errors will display some diagnostics as to where the error occurs. Copy and paste into a code box opened with the forums </> icon.

 

Did you try:

proc surveymeans data=meps.analysis;
var  adj_RXEXPY1 adj_RXEXPY2 adj_TOTEXPY1 adj_TOTEXPY2;
 stratum varstr;
cluster varpsu;
weight poolwt;
domain subpop/ dfadj diff;
run;
AliRKM
Obsidian | Level 7

Thanks for your answer and comment on how best to submit.

Adding dfadj did not work.

What does it do?

26         proc surveymeans data=meps.analysis;
27         var  adj_RXEXPY1 adj_RXEXPY2 adj_TOTEXPY1 adj_TOTEXPY2;
28          stratum varstr;
29         cluster varpsu;
30         weight poolwt;
31         domain subpop/ dfadj diff;
                                ____
                                22
                                202
ERROR 22-322: Expecting ;.  
ERROR 202-322: The option or parameter is not recognized and will be ignored.
32         run;
ballardw
Super User

The error message you are showing makes me think that you may not have one of the versions of SAS/Stat installed that has the DIFF option.

Run this code:


proc product_status; run;

Find the line in the log that looks something like:

For SAS/STAT ...
   Custom version information: 14.2

If the version is 14.1 or less then the DIFF option is not available for Surveymeans domain statement. In 14.1 the only option available for Domain is DFADJ. Which adjusts degrees of freedom for strata with missing domain variable values.

AliRKM
Obsidian | Level 7

Version 14.1 😞

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 1466 views
  • 1 like
  • 2 in conversation