<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to do customized hypothesis tests in proc rmstreg in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/786994#M38578</link>
    <description>&lt;P&gt;Using&amp;nbsp;the RMSTREG procedure, I would like to know the group effect adjusting for sex. In the model, the interaction term is also included. The group has two categories, A and B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The model is intercept+ beta1*group+beta2*sex+beta3*group*sex.&amp;nbsp;For the overall group effect test, the hypothesis is beta1 (group effect in male) = beta1+beta3 (group effect in female)=0. which is same as beta1=beta3=0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to test the hypothesis ( beta1=beta3=0.) in Proc RMSTREG or manually in SAS?&amp;nbsp; Does the estimate statement work for this? 'estimate' is colored in red in my code... I am not sure about the reason. and the ESTIMATE output showed nothing. My SAS version is 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the dataset&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data rmst;
input Obs	time	status	group$	Sex$;
cards;
3	49	1	A	M
4	70	0	A	M
5	31	1	B	M
6	28	1	B	M
7	56	1	A	M
8	70	0	A	M
9	35	1	A	M
10	35	1	A	M
11	42	1	B	M
12	70	0	B	M
17	35	1	B	M
18	35	1	B	M
19	45	1	A	M
20	63	0	A	M
23	33	1	A	M
24	33	1	A	M
27	31	1	A	M
28	45	1	A	M
31	45	1	A	M
32	35	1	A	M
35	63	0	A	M
36	63	0	A	M
39	28	1	A	F
40	54	1	A	F
41	52	1	A	F
44	42	1	B	F
45	47	1	B	F
46	28	1	B	F
47	28	1	B	F
48	70	0	A	F
49	70	0	A	F
50	70	0	A	F
53	70	0	B	F
54	28	1	B	F
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the code I tried.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc rmstreg data=rmst;
class Sex group ;
lsmeans group*Sex/e diff;
estimate group 1 0 Sex*group -1 0 0 0;
model time*status(0) = group|Sex;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the ESTIMATE output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yahousas_0-1640109919518.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66926i40FF8168D29A9158/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yahousas_0-1640109919518.png" alt="yahousas_0-1640109919518.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 01:58:42 GMT</pubDate>
    <dc:creator>yahousas</dc:creator>
    <dc:date>2021-12-22T01:58:42Z</dc:date>
    <item>
      <title>How to do customized hypothesis tests in proc rmstreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/786994#M38578</link>
      <description>&lt;P&gt;Using&amp;nbsp;the RMSTREG procedure, I would like to know the group effect adjusting for sex. In the model, the interaction term is also included. The group has two categories, A and B.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The model is intercept+ beta1*group+beta2*sex+beta3*group*sex.&amp;nbsp;For the overall group effect test, the hypothesis is beta1 (group effect in male) = beta1+beta3 (group effect in female)=0. which is same as beta1=beta3=0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to test the hypothesis ( beta1=beta3=0.) in Proc RMSTREG or manually in SAS?&amp;nbsp; Does the estimate statement work for this? 'estimate' is colored in red in my code... I am not sure about the reason. and the ESTIMATE output showed nothing. My SAS version is 9.4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the dataset&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data rmst;
input Obs	time	status	group$	Sex$;
cards;
3	49	1	A	M
4	70	0	A	M
5	31	1	B	M
6	28	1	B	M
7	56	1	A	M
8	70	0	A	M
9	35	1	A	M
10	35	1	A	M
11	42	1	B	M
12	70	0	B	M
17	35	1	B	M
18	35	1	B	M
19	45	1	A	M
20	63	0	A	M
23	33	1	A	M
24	33	1	A	M
27	31	1	A	M
28	45	1	A	M
31	45	1	A	M
32	35	1	A	M
35	63	0	A	M
36	63	0	A	M
39	28	1	A	F
40	54	1	A	F
41	52	1	A	F
44	42	1	B	F
45	47	1	B	F
46	28	1	B	F
47	28	1	B	F
48	70	0	A	F
49	70	0	A	F
50	70	0	A	F
53	70	0	B	F
54	28	1	B	F
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the code I tried.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc rmstreg data=rmst;
class Sex group ;
lsmeans group*Sex/e diff;
estimate group 1 0 Sex*group -1 0 0 0;
model time*status(0) = group|Sex;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the ESTIMATE output.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yahousas_0-1640109919518.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66926i40FF8168D29A9158/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yahousas_0-1640109919518.png" alt="yahousas_0-1640109919518.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 01:58:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/786994#M38578</guid>
      <dc:creator>yahousas</dc:creator>
      <dc:date>2021-12-22T01:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to do customized hypothesis tests in proc rmstreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/787072#M38580</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you sort it out meanwhile?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't think you need the ESTIMATE statement&lt;/P&gt;
&lt;P&gt;, you need the TEST statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TEST age1ht=0, age2ht=0; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 09:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/787072#M38580</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-12-22T09:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to do customized hypothesis tests in proc rmstreg</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/787139#M38587</link>
      <description>&lt;P&gt;Thank you. I sorted out the data and tried the test statement but I got a syntax error message. Is there any way to fix it? or any other suggestions?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I used. (I think you meant I need to dummy variables manually and use the test?, here is the reference,&amp;nbsp;&lt;A href="https://stats.oarc.ucla.edu/sas/faq/how-can-i-compare-regression-coefficients-across-three-or-more-groups/" target="_blank"&gt;https://stats.oarc.ucla.edu/sas/faq/how-can-i-compare-regression-coefficients-across-three-or-more-groups/&lt;/A&gt; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data rmst2;
set rmst;
sex_f=.;
sex_m=.;
if Sex='F' then sex_f=1; ELSE sex_f=0;
if Sex='M' then sex_m=1; ELSE sex_m=0;
group_a=.;
group_b=.;
if group='A' then group_a=1;ELSE group_a=0;
if group='B' then group_b=1;ELSE group_b=0;

sfga=sex_f*group_a;
sfgb=sex_f*group_b;
smga=sex_m*group_a;
smgb=sex_m*group_b;
run;

proc rmstreg data=rmst2;
class sex_f sex_m group_a group_b sfga sfgb smga smgb;
model time*status(0) = sex_f sex_m group_a group_b sfga sfgb smga smgb ;
*lsmeans group*Sex/e diff;
test group_a=0,sfga=0 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the relevant log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;369  proc rmstreg data=rmst2;
NOTE: PROCEDURE RMSTREG used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
370  class sex_f sex_m group_a group_b sfga sfgb smga smgb;
371  model time*status(0) = sex_f sex_m group_a group_b sfga sfgb smga smgb ;
372  *lsmeans group*Sex/e diff;
373  test group_a=0,sfga=0 ;
                 -
                 22
                 76
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, *, -, /, :, @,
              _CHARACTER_, _CHAR_, _NUMERIC_, |.
ERROR 76-322: Syntax error, statement will be ignored.
374  run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 17:18:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-do-customized-hypothesis-tests-in-proc-rmstreg/m-p/787139#M38587</guid>
      <dc:creator>yahousas</dc:creator>
      <dc:date>2021-12-22T17:18:21Z</dc:date>
    </item>
  </channel>
</rss>

