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
- /
- General Programming
- /
- SAS code for comparing individual improvement in e...

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

04-11-2014 11:03 AM

I am trying to write a code to look at if a subject improved in their education level after finishing prenatal program. I have their education level when they entered the program and their education level when they exited the program. I would like to know if they improved in education.

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

04-11-2014 11:20 AM

check proc ttest .proc par1way ;

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

04-11-2014 11:41 AM

I thought proc ttest was for means so I didn't think that would work. What is proc par1way? The categories for education level are:

01: less than 8th grad

03: some high school

02: high school grad/ged

04: some college

05: two year degree

06: four year degree

07: graduate school

09: vocational school

08: unknown

The mother's are asked about their education level at the intial enterance to the program and at the exit of the program.

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

04-11-2014 12:32 PM

Are you talking about multi-compare .

check proc glm + mean

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

04-11-2014 12:39 PM

Well, social studies is not my realm but, given that Post-Program occurs after Pre-Program and that education level can only go up with time (if Unknown is taken out), I would say that education level can only go up between Pre and Post program.

If you enroll enough subjects, you are bound to show an average improvement in education level.

It might be more useful to estimate the fraction of mothers that improved their education level during the prenatal program.

PG

PG

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

04-11-2014 12:43 PM

PGStats,

That is what I am trying to estimate. The fraction of mothers who showed improvment from initial to exit. So improvment being anything better than they're initial education level: "some high school" better than "less than 8th grade" or "high school grad/GED" better than "some high school" etc and so on. I am just not sure how to code for that since they are not means, but values assigned to different categories.

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

04-11-2014 01:11 PM

For a simple estimate, assuming education levels are number and not character variables, you could use something like:

**%let missingEdLevel=8;**

**proc sql;**

**select sum(exitEdLevel > entryEdLevel) / count(exitEdLevel) as percentImproved format=percentn7.1**

**from myData**

**where entryEdLevel ne &missingEdLevel and exitEdLevel ne &missingEdLevel;**

**quit;**

PG

PG

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

04-11-2014 07:28 PM

I would consider the following valid:

Remove unknown.

Your categories are generally ordinal not nominal, so 8 is better than 7 with the exception of 9, which is vocational school. Perhaps change the coding to deal with that. But what happens if someone has a 4 year degree and vocational school...which is considered the higher education? Assuming it's a single selection field.

If you do categorize with an ordinal scale you can do a t-test with paired analysis.

SAS/STAT(R) 9.2 User's Guide, Second Edition

Check your data to ensure that you don't have any negatives due to incorrect coding, since its essentially impossible to unachieved an education level.

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

04-11-2014 10:53 PM

I don’t consider appropriate to submit a non-negative variable to a t-test. Individual improvement could however be modelled as a binomial variate and its proportion be estimated with something like:

**/* Create a variable that has value 1 when there is individual improvement and zero otherwise */**

**%let missingEdLevel=8;**

**proc sql;**

**create table test as**

**select *, **

** exitEdLevel > entryEdLevel as improvedEd**

**from myData**

**where **

** entryEdLevel ne &missingEdLevel and **

** exitEdLevel ne &missingEdLevel ;**

**quit;**

**/* Estimate individual improvement proportion and compare the estimate with a treshold, 10% for example */**

**proc freq data=test;**

**table improvedEd / binomial(exact level="1" p=0.1);**

**exact binomial;**

**run;**

Proc freq also provides other useful tests for proportions.

PG

PG

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

04-11-2014 11:09 PM

That has the same issue as a t-test, the 09 code isn't necessarily higher than a vocational school. The data would have to be recoded somehow first.

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

04-11-2014 05:47 PM

Simplest way is to run a crosstab between before and and after education levels. If most of the numbers are on the diagonal then there is no improvement. With regard to statistical point of view you can run a chi-square test.

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

04-11-2014 09:59 PM

I know it is McNemar's test .Check AGREE option of proc freq. But that is only suited for 2*2 contingency table.

I recommend to use corresponding analysis for n*n contingency table.