Hello, I am manipulating my data using the following code: /*Convert motherheight to height in inches*/ DATA LabAnal.study_cohort_2; SET LabAnal.study_cohort; IF MotherHeight = '' THEN Ht_Inches = .; ELSE IF MotherHeight ='?' THEN Ht_Inches =''; ELSE Ht_Inches=(INPUT(SUBSTR(MotherHeight, 1, 2), 2.)*12) + (INPUT(SUBSTR(MotherHeight, 4, 2),2.)); RUN; ^^this works great /*Convert priorweight to a numeric variable*/ DATA LabAnal.study_cohort_2; SET LabAnal.study_cohort; Priorweight2 = INPUT(PriorWeight, 3.); RUN; ^^this also works great /*Calculate BMI*/ DATA LabAnal.study_cohort_2; SET LabAnal.study_cohort; IF Priorweight2= "." or Ht_inches= "." THEN BMI= "."; ELSE BMI= (Priorweight2*703)/(Ht_Inches*2); RUN; ^^but when I run this, it sets all the values from priorweight2, ht_inches and BMI to missing. I've tried with and without quotes around the periods in the IF statement for BMI code. It doesn't change anything.
... View more
Hello, I'm trying to removed the entire legend from this graph. I tried using KEYLEGEND / TITLE = " "; but that only removed the wording title that was beside the 'Yes' legend (as pictured). Here's the code: PROC SGPLOT DATA =Data code code code XAXIS OFFSETMIN = 0.25 LABEL = "State Code" LABELATTRS = (WEIGHT = BOLD); KEYLEGEND / TITLE = " "; *Does not get rid of entire legend?*;
... View more
As others have mentioned, it has to do with leading zero's in some of your observations ssn's. Go to your Utah demog dataset from the previous project and add this: ID = PUT(NewID,z9.); before you string together your SSN using CatX. OR If that doesn't work the other code to try using Z9 in the SUBSTR as follows: SSN = CATX('-', SUBSTR(PUT(ID,Z9.),1,3), SUBSTR(PUT(ID,Z9.), 4,2), SUBSTR (PUT(ID,Z9.),6,4)); Good Luck.
... View more
You have XAXIS and YAXIS LABEL(s) but I believe you need to define them as such, ie XAXIS LABEL = 'Ethnicity Race code ' and then use LABELATTRS = (WEIGHT = BOLD), same for YAXIS.
... View more
Thanks Allie. That was all it was. I wrote a PROC FREQ for the StatePercents and thought that was sufficient. During office hours I tried adding the PROC FREQ after the ODS OUTPUT but it did not work. Now of course, it worked. Sas hates me. Good Luck!
... View more
That worked for me. I had 2 ODS OUTPUT statements and was thinking the proc freq I ran with the first one was sufficient when I ran this one. Thanks!
... View more
My code: ODS OUTPUT ChiSq = data set (DROP = TABLE WHERE = (STATISTIC = 'Chi-Square')); PROC PRINT DATA =data set; RUN; I get the following warning: WARNING: Output 'ChiSq' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.
... View more