Hi:
There are syntax errors and logic errors in the program. Did you fix those errors? The answers given at the bottom of your screen shot are correct. When I run the program, after fixing the issues, here's what I see:
So I do find 1405 rows with low cholesterol and 3652 with high cholesterol and 152 have cholesterol values missing. Remember that missing values for numeric variables are tested using a . (not a quoted '.' as shown in the program). So one place to start would be to get rid of this NOTE that you might be seeing if you submit the original program unchanged:
There are 2 problems with the above IF statement -- the dot (.) for missing should NOT be quoted and the NE means "not equal". However, to write to work.misschol you need to test whether the value for cholesterol EQ (or equal to) . or missing.
The other issue is that IF you leave the test for missing at the bottom of the 3 IF statements, then the missing will also get output to the LOWCHOL data set and you'll have the wrong number of obs, as shown below:
So now you've got to fix the logic problem involving the IF statements. There are a few different ways to do that. Here are two of them:
I'd recommend going back and review the material on IF statements in the Programming 1 and Programming 2 classes to help you understand why this program didn't work initially and how you needed to fix it to get the right answers.
Cynthia