<?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 Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624845#M30067</link>
    <description>&lt;P&gt;These references, which might help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/35/189.html" target="_self"&gt;&lt;SPAN&gt;Estimating the odds ratio for X in a logistic model containing a polynomial or spline of X&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/455.html" target="_self"&gt;&lt;SPAN&gt;Estimating an odds ratio for a variable involved in an interaction&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With respect to your conjecture that you ought to be able to use the UNITS statement to specify the difference between 5 and 10, here is some UNTESTED code that you might try to modify. The model does not converge on your small sample data. I tried adding a few more observations, but finally gave up. Maybe someone can use this as a starting point for discussion.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA dataset;
	INPUT Y matchgroup substance1;
   x = substance1;
   substance1_2 = substance1**2;
   substance1_3 = substance1**3;
	DATALINES;
	0 1 2
	0 2 5
	0 3 10
	1 4 20
   1 5 15
   1 6 11
   0 7 8
	0 1 3
	1 2 8
	1 3 18
	0 4 15
   1 5 16
   1 6 13
   1 7 11
;

/* UNTESTED */
title Univariate logistic regression on dataset - substance1_2 substance1_3;
proc logistic data=dataset outest=betas_substance1;
   strata matchgroup;
   effect poly = polynomial(x / degree=3);
   model Y(event='1')= poly / alpha=0.1;
   oddsratio x / at(x=5);
   units x = 10;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2020 14:29:21 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-02-14T14:29:21Z</dc:date>
    <item>
      <title>Confidence interval/standard error of predictor consisting of 2 variables- conditional PROC LOGISTIC</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624459#M30057</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In&amp;nbsp;a matched case-control study, the outcome is case (0/1), the predictor variable is the continuous substance1. The best model&amp;nbsp;had two fractional polynomials, i.e., substance1 squared (named substance1_2) and substance1 raised to the power of 3 (named substance1_3).&lt;/P&gt;&lt;P&gt;I ran PROC LOGISTIC with model case = substance1_2 substance1_3.&lt;/P&gt;&lt;P&gt;I managed to calculate the odds ratio for a change in substance1 from 15 to 5 units. In order to calculate the 90% CI, I will need the standard error. How can I calculate the standard error for this OR? I believe that the UNITS or ODDSRATIO statement may be helpful, but I don't know how to do it (&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_logistic_syntax36.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_logistic_syntax36.htm&amp;amp;docsetVersion=15.1&amp;amp;locale=en&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;It would be great if someone can help me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Example (real dataset is much longer);
DATA dataset;
	INPUT case matchgroup substance1 substance1_2 substance1_3;
	DATALINES;
	1 1 2 4 8
	0 2 5 25 125
	0 3 10 100 1000
	1 4 20 400 8000
	0 1 15 225 3375
	0 2	8	64	512
	0 3	3	9	27
	0 4	17	289	4913
	1 1	12	144	1728
RUN;


title Univariate logistic regression on dataset - substance1_2 substance1_3;
proc logistic data=dataset outest=betas_substance1;
  		strata matchgroup;
       	model case(event='1')= substance1_2 substance1_3 / alpha=0.1;
run;

* Intermediate step: Regression coefficients in output betas_substance1 were renamed to beta_substance1_2 and beta_substance1_3
....;

DATA dataset;
	SET dataset;

	* log odds and odds ratio;
	log_odds_substance1 = beta_substance1_2*(15**2-5**2) + beta_substance1_3*(15**3-5**3);
	OR_substance1 = exp(log_odds_substance1);

	* 90% CI;
	Standard_error_substance1 = ????;
	LCI_OR_substance1 = exp(log_odds_substance1 - Standard_error_substance1*1.645);
	UCI_OR_substance1 = exp(log_odds_substance1 + Standard_error_substance1*1.645);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 07:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624459#M30057</guid>
      <dc:creator>Danaus</dc:creator>
      <dc:date>2020-02-18T07:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624468#M30058</link>
      <description>&lt;P&gt;According to the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_logistic_toc.htm&amp;amp;locale=en" target="_self"&gt;PROC LOGISTIC documentation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The CLODDS= option in the MODEL statement of PROC LOGISTIC is what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/36100i768F15C06B66A761/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 13:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624468#M30058</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-13T13:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624473#M30059</link>
      <description>&lt;P&gt;Thank you. However, it says that the CLODDS= option does not work with the STRATA Statement, and I need the STRATA statement in my regression procedure (since it is a matched case-control study). Any other idea?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 14:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624473#M30059</guid>
      <dc:creator>Danaus</dc:creator>
      <dc:date>2020-02-13T14:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624527#M30060</link>
      <description>&lt;P&gt;I think you misread the doc. It says that the CLODDS=PL option is not supported when you use the STRATA statement, but the CLODDS=WALD option is supported and generates the CIs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:47:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624527#M30060</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-02-13T16:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624746#M30063</link>
      <description>&lt;P&gt;Thank you, you're right.&lt;/P&gt;&lt;P&gt;However, using CLODDS does not solve the problem, or I don't know how to do it (see what I did below). I get odds ratios for substance1_2 and substance1_3.&lt;/P&gt;&lt;P&gt;But what I am looking for is the odds ratio&amp;nbsp;of substance1 (not _2 or _3) for the difference 15 to 5 (I already did that, see my first post), and&amp;nbsp;I&amp;nbsp;need to calculate the&amp;nbsp;90% CI for this odds ratio (for which I need the standard error). Will the covariance help to find the standard error? If so, how would I go about it (I just know that you can output it with covout)?&lt;/P&gt;&lt;P&gt;I appreciate any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title Univariate logistic regression on dataset - substance1_2 substance1_3;
proc logistic data=dataset outest=betas_substance1;
  	strata matchgroup;
       	model case(event='1')= substance1_2 substance1_3 / clodds = wald alpha=0.1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 07:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624746#M30063</guid>
      <dc:creator>Danaus</dc:creator>
      <dc:date>2020-02-14T07:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624794#M30064</link>
      <description>&lt;P&gt;Then you have the wrong model. If you want information about substance_1 and not about substance1_2, you need to redefine the model and then the CLODDS= does give you what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 12:07:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624794#M30064</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-14T12:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624844#M30066</link>
      <description>&lt;P&gt;Thanks for your answer.&lt;BR /&gt;I'm afraid that I cannot&amp;nbsp;phrase my question statistically clearly. I'll give it another try:&lt;/P&gt;&lt;P&gt;I&amp;nbsp;calculated ONE odds ratio for the function "beta2*substance1_2&amp;nbsp;&amp;nbsp;+ beta3*substance1_3" and need the corresponding 90% CI. I want to know how much higher is the odds to be a case for a unit of 15 compared to a unit of 5 (in the&amp;nbsp;untransformed variable substance1) if the function that describes the relationship between substance1 and being a case is not a straight line, namely beta2*substance1²&amp;nbsp;&amp;nbsp;+ beta3*substance1³.&lt;/P&gt;&lt;P&gt;It would be great to hear your ideas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2020 07:57:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624844#M30066</guid>
      <dc:creator>Danaus</dc:creator>
      <dc:date>2020-02-18T07:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624845#M30067</link>
      <description>&lt;P&gt;These references, which might help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/35/189.html" target="_self"&gt;&lt;SPAN&gt;Estimating the odds ratio for X in a logistic model containing a polynomial or spline of X&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/455.html" target="_self"&gt;&lt;SPAN&gt;Estimating an odds ratio for a variable involved in an interaction&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;With respect to your conjecture that you ought to be able to use the UNITS statement to specify the difference between 5 and 10, here is some UNTESTED code that you might try to modify. The model does not converge on your small sample data. I tried adding a few more observations, but finally gave up. Maybe someone can use this as a starting point for discussion.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA dataset;
	INPUT Y matchgroup substance1;
   x = substance1;
   substance1_2 = substance1**2;
   substance1_3 = substance1**3;
	DATALINES;
	0 1 2
	0 2 5
	0 3 10
	1 4 20
   1 5 15
   1 6 11
   0 7 8
	0 1 3
	1 2 8
	1 3 18
	0 4 15
   1 5 16
   1 6 13
   1 7 11
;

/* UNTESTED */
title Univariate logistic regression on dataset - substance1_2 substance1_3;
proc logistic data=dataset outest=betas_substance1;
   strata matchgroup;
   effect poly = polynomial(x / degree=3);
   model Y(event='1')= poly / alpha=0.1;
   oddsratio x / at(x=5);
   units x = 10;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 14:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624845#M30067</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-02-14T14:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624865#M30068</link>
      <description>&lt;P&gt;Thank you very much! I find your post a very useful starting point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestion with&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; effect poly = polynomial(x / degree=3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;works well if the model is&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN class="token procnames"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; model Y(event='1')= substance1 substance1*substance1 substance1*substance1*substance;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="token procnames"&gt;My model is different, though, and in fact, I also have other models which include, e.g.,&amp;nbsp;the log-transformation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token procnames"&gt;I think you reference&amp;nbsp; &lt;A href="http://support.sas.com/kb/35/189.html" target="_blank"&gt;http://support.sas.com/kb/35/189.html&lt;/A&gt;&amp;nbsp;with the code&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;      proc logistic;
         model y = x x*x;
         contrast 'Log OddsRatio for X' x 1 x*x 7 / estimate=exp;
         estimate 'Log OddsRatio for X' x 1 x*x 7 / exp cl;
       run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class="token procnames"&gt;may be useful there. Do you think it will work for different types of transformations in the same model (e.g. ³ and log-transformation)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="token procnames"&gt;If I can find the solution, I'll post it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 15:31:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/624865#M30068</guid>
      <dc:creator>Danaus</dc:creator>
      <dc:date>2020-02-14T15:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Confidence interval/standard error of variable consisting of 2 predictors- conditional PROC LOGI</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/631822#M30294</link>
      <description>&lt;P&gt;The code you can find here did the trick&lt;SPAN class="token procnames"&gt;&amp;nbsp; &lt;A href="http://support.sas.com/kb/35/189.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://support.sas.com/kb/35/189.html&lt;/A&gt;&amp;nbsp;. It works for different transformations. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;      &lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;logistic&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
         &lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; y &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; x x&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;x&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
         contrast &lt;SPAN class="token string"&gt;'Log OddsRatio for X'&lt;/SPAN&gt; x &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; x&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;x &lt;SPAN class="token number"&gt;7&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; estimate&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
         estimate &lt;SPAN class="token string"&gt;'Log OddsRatio for X'&lt;/SPAN&gt; x &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; x&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;x &lt;SPAN class="token number"&gt;7&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt; cl&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
       RUN;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 11:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Confidence-interval-standard-error-of-predictor-consisting-of-2/m-p/631822#M30294</guid>
      <dc:creator>Danaus</dc:creator>
      <dc:date>2020-03-13T11:44:51Z</dc:date>
    </item>
  </channel>
</rss>

