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
- /
- 0 obs with chi square

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

02-29-2012 02:27 PM

I have a table that has multiple rows but within the table I have 2 columns. 1 is NoReadm and the other YesReadm

The no has 0 and the Yes has 1. There are 774 rows in all. 39 of those rows have the 1 and the rest are 0. I want a chi square and am doing the following code off the table.

proc freq data = readm..final

tables noreadm * yesreadm/chisq;

run;

I am getting the output the freq procedure table of noreadm and yesreadm effective sample size = 0

frequency missing =774

Not sure what that means or how to fix this

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

02-29-2012 02:35 PM

Not sure I understand your question. Is there a fixed relationship between NoReadm and YesReadm?

PG

PG

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

Posted in reply to PGStats

02-29-2012 02:37 PM

Not sure what you mean by fixed relationship. Do I need to add the two columns together somehow to get 774? Like have a column that is noreadm that has the 0 then yesreadm that has the 1 and then another column that maybe is count or something that houses the 0 and the 1's?

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

02-29-2012 02:43 PM

Chi square tests whether there is a relation between two characteristics. For instance, if having NoReadm=1 changes the probability of having also YesReadm=1. Is this the kind of thing you are trying to test?

PG

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

02-29-2012 03:13 PM

I'll follow on to PGStats question. I think for any record you have either (noReadm=0, yesReadm=1) or (noReadm=1, yesReadm=0). If that is the case, what other characteristic would drive this? Without another characteristic, the probability of noReadm=0 is exactly that of yesReadm=1, and is exactly equal to 1 minus the probability of noReadm=1 (and 1 minus the probability of yesReadm=0). A second characteristic would lead to a 2 x 2 or a 2 x k table.

If you want to test whether the proportion of noReadm is equal to a fixed value, you can do that with:

proc freq data=yourdata;

tables noReadm/chisq testp=0.5;

run;

This would test if the proportion of noReadm in your sample is equal to 0.5, using a chi-squared test.

Steve Denham

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

Posted in reply to SteveDenham

02-29-2012 03:33 PM

tmm,

Maybe you could show a snippet of your data. I suspect that you may also have a data coding issue going on. In the yesreadm variable, it is coded 1 if there is a readm present. What is yesreadm coded if readm is NOT present. If it is coded with a null ("."), that may be the heart of the matter and you need to add the MISSING option to the code that Steve posted last. The MISSING option treats nulls as valid values for the computation of the test.

Doc Muhlbaier

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

02-29-2012 04:03 PM

Key questions (perhaps overlapping with the comments of others) ...

When you look at NOREADM and YESREADM individually, how often are they missing? Do they have any formats connected with them?

That should be enough to make the answer obvious.