<?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: PROC PHREG Error: &amp;quot;Variable_ does not have the same format as in the input data&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576662#M163266</link>
    <description>Thank you Ballardw! It was indeed a format issue</description>
    <pubDate>Thu, 25 Jul 2019 15:44:38 GMT</pubDate>
    <dc:creator>Jake3</dc:creator>
    <dc:date>2019-07-25T15:44:38Z</dc:date>
    <item>
      <title>PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576635#M163246</link>
      <description>&lt;P&gt;Hi there&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first post so apologies if I'm missing anything.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing a survival analysis and one of the tasks I wish to do is to estimate survival curves for males and females &lt;SPAN&gt;after controlling for age. My mean age is&amp;nbsp;39.93673111.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;First I create&amp;nbsp;a dataset of covariate values in the data step. Each row contains a set of covariate values for which I would like a survival plot.&lt;/SPAN&gt;&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;data control;
input Sex$6. Age;
datalines;
Female 39.93673111 
Male  39.93673111 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I thus get&amp;nbsp;a dataset called “control” with 2 rows of covariates&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Next, I utilize the following SAS Code to run my plot&lt;/SPAN&gt;&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;proc phreg data = Survival plots(overlay)=(survival);
class Sex;
model Time*Event(0) = Sex Age;
baseline covariates=control out=base / rowid= Sex;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I get the following error&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"ERROR: Variable Sex in WORK.CONTROL does not have the same format as in the input data."&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I checked and my format, Length, and variable type are the same between the "Control" dataset and my "Survival" dataset for Age and Sex.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there anything wrong with my code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576635#M163246</guid>
      <dc:creator>Jake3</dc:creator>
      <dc:date>2019-07-25T15:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576645#M163251</link>
      <description>Can you show a proc freq output for sex on both data sets?</description>
      <pubDate>Thu, 25 Jul 2019 15:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576645#M163251</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-25T15:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576651#M163254</link>
      <description>&lt;P&gt;Sure. Here is one for the "Control" dataset&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Control.png" style="width: 386px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31307iA391B4F9EC7DEB3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Control.png" alt="Control.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and here is the one for the "Survival" dataset&amp;nbsp;&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="Main.png" style="width: 390px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31308iA8CE78ADF8FBB4ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Main.png" alt="Main.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576651#M163254</guid>
      <dc:creator>Jake3</dc:creator>
      <dc:date>2019-07-25T15:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576655#M163258</link>
      <description>&lt;P&gt;Sorry, can you run that again with formats stripped? I'm assuming it's a character variable? You can use an 'empty' format statement as below to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=have;
table varName;
format _character_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576655#M163258</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-25T15:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576656#M163259</link>
      <description>&lt;P&gt;I suspect that if you check the properties of the variable in your Survival data set you will find Sex is a numeric variable. Possibly there is format associated with it to display text like Female or Male but the variable is numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do not know how to check properties, one way:&lt;/P&gt;
&lt;P&gt;Proc contents data=survival;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;The results window will show information about the data set and list of variables and the types.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576656#M163259</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-25T15:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576660#M163265</link>
      <description>Hi Reeza&lt;BR /&gt;&lt;BR /&gt;Really appreciate you taking the time to help me. I figured out what the issue was. When I do that I get the same results</description>
      <pubDate>Thu, 25 Jul 2019 15:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576660#M163265</guid>
      <dc:creator>Jake3</dc:creator>
      <dc:date>2019-07-25T15:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576662#M163266</link>
      <description>Thank you Ballardw! It was indeed a format issue</description>
      <pubDate>Thu, 25 Jul 2019 15:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576662#M163266</guid>
      <dc:creator>Jake3</dc:creator>
      <dc:date>2019-07-25T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576664#M163267</link>
      <description>&lt;P&gt;Thank you to all who helped steer me in the right direction!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my SAS code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data control;
format Sex$6. Age;
input Sex$6. Age;
datalines;
Female 39.93673111 
Male  39.93673111 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It was the format command that I needed to incorporate!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a wonderful day everyone!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576664#M163267</guid>
      <dc:creator>Jake3</dc:creator>
      <dc:date>2019-07-25T15:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG Error: "Variable_ does not have the same format as in the input data"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576668#M163268</link>
      <description>&lt;P&gt;You should mark&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; as the correct solution, not your own answer.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2019 15:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-Error-quot-Variable-does-not-have-the-same-format-as/m-p/576668#M163268</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-25T15:47:54Z</dc:date>
    </item>
  </channel>
</rss>

