turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Data Missing on output.

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-05-2018 09:14 PM

Data UGAStudent_DATA; Set date_difference; if cd4 <= '200' then cd4_levels='1'; if cd4 >='201' <='500' then cd4_levels='2'; if cd4 > '500' then cd4_levels='3'; run; proc genmod data= ugastudent_data ; class cd4_levels ; model Factor3 = cd4_levels n_Duration_on_ART_months ; run;

I'm trying to run the proc genmod command, but when I look at level 3, it has 0s across the board but levels 1 and 2 have values. How do I get my level 3 data to show up? Its like the data is missing or something

Accepted Solutions

Solution

03-08-2018
01:49 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-07-2018 10:40 AM

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-05-2018 09:21 PM - edited 02-05-2018 09:22 PM

That's the correct results for a categorical variable, only N-1 levels will have estimates. If you have 3 levels, you only need two variables to identify the third, so you only have estimates for two variables. Review dummy variables and the degrees of freedom in your statistics textbook.

In matrix language, they would be linear combinations of each other.

You can use different dummy coding, but it depends on what you're trying to test.

UGAstudent wrote:

Data UGAStudent_DATA; Set date_difference; if cd4 <= '200' then cd4_levels='1'; if cd4 >='201' <='500' then cd4_levels='2'; if cd4 > '500' then cd4_levels='3'; run; proc genmod data= ugastudent_data ; class cd4_levels ; model Factor3 = cd4_levels n_Duration_on_ART_months ; run;I'm trying to run the proc genmod command, but when I look at level 3, it has 0s across the board but levels 1 and 2 have values. How do I get my level 3 data to show up? Its like the data is missing or something

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-05-2018 09:31 PM

Another issue to consider ... is CD4 numeric or character?

If CD4 is numeric, there should not be quotes around '200' and '201' and '500'.

If CD4 is character, the comparisons you are asking for may be different than what you expect. As character strings:

'51' and '60' are both greater than '500'

'1000' is less than '200'

I can't tell what is in your data, but I can tell that these comparisons are suspect.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Astounding

02-06-2018 09:24 AM

Hi,

CD4 is numerical (as in HIV CD4 count). I removed the quotations around the 200, 201, and 500, and everything seems to work alright. I know how to create a dummy variable for a logistical regression, but I’m not sure if its the same process.

Thanks again !

CD4 is numerical (as in HIV CD4 count). I removed the quotations around the 200, 201, and 500, and everything seems to work alright. I know how to create a dummy variable for a logistical regression, but I’m not sure if its the same process.

Thanks again !

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-06-2018 04:13 PM

If your question is answered please mark it as solved.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

02-07-2018 09:23 AM

Hi Reeza,

CD4 is numerical (as in HIV CD4 count). I removed the quotations around the 200, 201, and 500, and everything seems to work alright. I know how to create a dummy variable for a logistical regression, but I’m not sure if its the same process for this command.

Thanks again !

Solution

03-08-2018
01:49 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-07-2018 10:40 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

02-07-2018 11:15 AM

Hi I've looked through the class and proc statements online information and tried to look up some things regarding dummy variables but I was not able to find a conclusion. Im not sure what the code should look like so I could start having information show up in the 3rd level created. What am I doing wrong?

```
Data UGAStudent_DATA;
Set date_difference;
if cd4 <= 200 then cd4_levels='1';
if cd4 >=201 <=500 then cd4_levels='2';
if cd4 > 500 then cd4_levels='3';
run;
proc genmod data= ugastudent_data;
class cd4_levels /param=glm ;
model Factor1 = cd4_levels n_Duration_on_ART_months ;
run;
```

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-06-2018 07:26 AM

class cd4_levels /param=glm ;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to UGAstudent

02-06-2018 03:11 PM

CD4 is numerical (as in HIV CD4 count). I removed the quotations around the 200, 201, and 500, and everything seems to work alright. I know how to create a dummy variable for a logistical regression, but I’m not sure if its the same process.

Thanks again !