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
- /
- Chi-square test for each row

- 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

10-21-2016 09:29 AM

Hi all,

I'm interested in knowing whether the individual levels of my row variable are related to my column variable in a contingency table.

Is SAS able to produce Chi-square tests for each row of your contingency table, in stead of a general chi-square test? I cannot seem to work out how to do it.

Thanks in advance!

Accepted Solutions

Solution

10-24-2016
06:50 AM

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

Posted in reply to Marjolein

10-24-2016 06:32 AM - edited 10-24-2016 06:42 AM

If you want test " each level of SES" , that mean these three row level is independent. That make "association" nonsense.

if column level from first to last , what gonna do with the single row level ? You can ONLY measure "association" between two variables which have more than two levels .

You can try Trend Analysis ,but that is only for 2xn or nx2 contingency table.

Example 40.8: Cochran-Armitage Trend Test

All Replies

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

Posted in reply to Marjolein

10-21-2016 10:32 AM - edited 10-21-2016 10:33 AM

You should provide a brief example of your data (variable names help the discussion) and the say which are needed for your test. Since chi-sq also wants count values you will need to indicate which are the category values and which are the counts for those values.

Often data needs to be reshaped before some tests.

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

Posted in reply to ballardw

10-24-2016 03:33 AM

OK, I understand!

For example: I have my row variable SES, with the levels low, moderate and high. I want to test, whether each level of SES is associated with physical activity which has been divided in four categories (no, moderate, active, severe). What I want to get out is 3 p-values, each indicating whether the level of SES (low, moderate and high) is associated with the level of physical activity.

I know that Chi-square generally tells you whether the two variables are associated, but can you also ask for row-specific tests?

Am I making myself more clear now? I hope so. Please let me know if not.

Solution

10-24-2016
06:50 AM

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

Posted in reply to Marjolein

10-24-2016 06:32 AM - edited 10-24-2016 06:42 AM

If you want test " each level of SES" , that mean these three row level is independent. That make "association" nonsense.

if column level from first to last , what gonna do with the single row level ? You can ONLY measure "association" between two variables which have more than two levels .

You can try Trend Analysis ,but that is only for 2xn or nx2 contingency table.

Example 40.8: Cochran-Armitage Trend Test

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

Posted in reply to Ksharp

10-24-2016 06:50 AM

OK I see, thank you!

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

Posted in reply to Marjolein

10-21-2016 11:27 PM

You mean One-Way Chi-square ?

```
proc freq data=sashelp.class;
where age=14;
table sex/ testp=(0.5 0.5); *testf=(10 6);
run;
```

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

Posted in reply to Ksharp

10-24-2016 03:37 AM

Not quite, see my more clear explanation above: I have two categorical variables, but I don't want to know whether they are related in general, but I want to see whether each level of my row variable (SES: low, moderate, high) is associated with my column variable (physical acitivy: four levels). So I want three P-values: each indicating whether the level of SES is associated with physical acitivity.