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.
check proc ttest .proc par1way ;
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.
Are you talking about multi-compare .
check proc glm + mean
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
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.
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
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.
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
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.
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.