BookmarkSubscribeRSS Feed
ddp29
Calcite | Level 5

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.

11 REPLIES 11
ddp29
Calcite | Level 5


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.

Ksharp
Super User

Are you talking about multi-compare .

check proc glm + mean

PGStats
Opal | Level 21

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
ddp29
Calcite | Level 5

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.

PGStats
Opal | Level 21

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
Reeza
Super User

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.

PGStats
Opal | Level 21

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
Reeza
Super User

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.

stat_sas
Ammonite | Level 13

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.

Ksharp
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 1038 views
  • 0 likes
  • 5 in conversation