<?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: &amp;quot;Invalid reference value&amp;quot; error for PROC CAUSALMED in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975679#M48943</link>
    <description>&lt;P&gt;This is a defect that is documented, along with a work-around, in the KB article linked below:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sas.service-now.com/csm/en/the-causalmed-procedure-incorrectly-issues-error-invalid-reference-value?id=kb_article_view&amp;amp;sysparm_article=KB0042813" target="_blank"&gt;SAS Support - The CAUSALMED procedure incorrectly issues "ERROR: Invalid reference value" when you specify the REF= option&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Sep 2025 17:26:06 GMT</pubDate>
    <dc:creator>SAS_Rob</dc:creator>
    <dc:date>2025-09-24T17:26:06Z</dc:date>
    <item>
      <title>"Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/974102#M48883</link>
      <description>&lt;P&gt;Hi, folks-&lt;/P&gt;&lt;P&gt;When I run this PROC CAUSALMED with a CLASS statement and reference values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc causalmed data=data.climate23 decomp pmedmod poutcomemod;
	class healthharm_rc (ref="No") trans (ref="Cisgender");
	model healthharm_rc = housing_instab | trans;
	mediator housing_instab = trans;
	format healthharm_rc yesno_alt. trans trans. housing_instab housing_instab.; 
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Invalid reference value for trans.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: No valid observations due to invalid or missing values in the outcome,&amp;nbsp; mediator, treatment, explanatory, weight, or frequency variable.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The really weird thing is that when I use the same CLASS statement in PROC LOGISTIC, the code produces no errors:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc logistic data=data.climate23;
	class healthharm_rc (ref="No") trans (ref="Cisgender");
	model healthharm_rc = housing_instab | trans;
	format healthharm_rc yesno_alt. trans trans. housing_instab housing_instab.; 
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even weirder, the above PROC CAUSALMED code was working just fine as recently as two weeks ago. I know that a workaround is (ref=FIRST), but it's really bugging me that code which worked so recently now doesn't. Also, it seems a surer bet to spell out the reference category rather than risk getting the SAS internal category order wrong--for example, (ref=LAST) would run but produce wrong results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Version info. is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Base SAS: 9.4_M8&lt;/P&gt;&lt;P&gt;- EGP: 8.4 Update 2&lt;/P&gt;&lt;P&gt;- SAS/STAT: 15.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on what I've read in five other posts in the support forums, here's what I've done so far in an attempt to fix the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Checked formats to ensure that the spellings are the same in PROC FORMAT and the reference value in the CLASS statement; that there aren't any leading or trailing blanks, etc.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc format;
	value yesno_alt		0='No'
				1='Yes'
				.='Missing';

	value trans		0='Cisgender'
				1='Transgender';

	value housing_instab	0 = 'Very Stable'
				1 = 'Fairly Stable'
				2 = 'Somewhat Stable'
				3 = 'Fairly Unstable'
				4 = 'Very Unstable';&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;2) Run PROC CONTENTS to see if that the above formats were properly attached to the corresponding variables. They are.&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Reset the SAS session and restarted SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's some sample data and code that reproduces the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc format;
	value yesno_alt		0='No'
				1='Yes'
				.='Missing';&lt;BR /&gt;
	value trans		0='Cisgender'
				1='Transgender';
run;

data person;
   infile datalines delimiter=','; 
   input healthharm_rc trans mediator;
   datalines;                      
0,1,3
0,1,4
1,0,3
1,0,3
1,1,2
0,0,2
1,1,1
0,1,1
0,0,1
1,1,4
;

proc logistic data=person;
	class healthharm_rc (ref="No") trans (ref="Cisgender");
	model healthharm_rc(event="Yes") = trans;
	format healthharm_rc yesno_alt. trans trans.;
run; 

proc causalmed data=data.climate23;
	class healthharm_rc (ref="No") trans (ref="Cisgender");
	model healthharm_rc = housing_instab | trans;
	mediator housing_instab = trans;
	format healthharm_rc yesno_alt. trans trans. housing_instab housing_instab.; 
run;&lt;/PRE&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 07:21:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/974102#M48883</guid>
      <dc:creator>dbcrow</dc:creator>
      <dc:date>2025-09-04T07:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: "Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/974121#M48884</link>
      <description>&lt;P&gt;This appears to be a defect of some sort.&amp;nbsp; I would suggest that you contact Technical Support directly so they can investigate the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 13:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/974121#M48884</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2025-09-04T13:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: "Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/974171#M48885</link>
      <description>Have done so. I'll let you know the outcome.</description>
      <pubDate>Thu, 04 Sep 2025 22:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/974171#M48885</guid>
      <dc:creator>dbcrow</dc:creator>
      <dc:date>2025-09-04T22:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: "Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975678#M48942</link>
      <description>&lt;P&gt;Running into this same issue and wondering you have received an answer? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 17:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975678#M48942</guid>
      <dc:creator>mm3215</dc:creator>
      <dc:date>2025-09-24T17:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: "Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975679#M48943</link>
      <description>&lt;P&gt;This is a defect that is documented, along with a work-around, in the KB article linked below:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://sas.service-now.com/csm/en/the-causalmed-procedure-incorrectly-issues-error-invalid-reference-value?id=kb_article_view&amp;amp;sysparm_article=KB0042813" target="_blank"&gt;SAS Support - The CAUSALMED procedure incorrectly issues "ERROR: Invalid reference value" when you specify the REF= option&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 17:26:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975679#M48943</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2025-09-24T17:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: "Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975689#M48944</link>
      <description>&lt;P&gt;Hi, SAS_Rob-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. From the posting dates, it looks like this issue might have become documented because of my original post (which also suggested one of the workarounds)! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea if the SAS Team is going to fix the underlying issue? The workarounds work, but, for the reasons I pointed out, aren't optimal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 18:55:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975689#M48944</guid>
      <dc:creator>dbcrow</dc:creator>
      <dc:date>2025-09-24T18:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: "Invalid reference value" error for PROC CAUSALMED</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975734#M48946</link>
      <description>&lt;P&gt;Yes, this should be fixed in the next release of SAS, although the timetable for its release is not set as of yet.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 13:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/quot-Invalid-reference-value-quot-error-for-PROC-CAUSALMED/m-p/975734#M48946</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2025-09-25T13:34:31Z</dc:date>
    </item>
  </channel>
</rss>

