It's likely better than your first, anyway - as it correctly identifies has/doesn't have status in at least one eye. You also may be able to do your chi-square analysis, though I'm not a statistician and won't dip my toe into whether this is an appropriate analysis. title "Patients with/without condition in any eye" Also note you have a nice dataset of patients. Patient_status = (patient_Status or status) If first.patientID then patient_status =0 We want a patient-level dataset at the end, where we have eye-level now. First I add one more row - someone who actually doesn't have - so we see that working. To set up a dataset of has/doesn't have, for example, let's do a few things. PROC SORT NODUPKEY is sort of overkill for example, and it doesn't really do what you want anyway. In general here you are using sort of blunt tools to accomplish what you're trying to accomplish, when you probably should use a more precise tool. PROC FREQ is doing what you told it to: counting the status=0 cases.
Does anyone have any thoughts on how to do this chi-square, where if the has this phenomena in at least 1 eye, then they are positive for this phenomena? However, in the cross table, it has the correct number of patients who have the phenomena (9), but not the correct number without (0). I now need to calculate the gender distribution of this phenomena.
However, it gave the correct number of patients with the phenomena (9), but not the correct number without (0). To count the number of patients with this eye phenomena, I used: PROC SORT data=new out=new1 nodupkey To get the number of total patients in the dataset, I used: PROC FREQ data=new nlevels I need the count the number of patients with this eye phenomena.
This is what some of the data looks like: EyeID PatientID STATUS GenderĪs you can see from the data above, there are 9 patients total and all of them have the particular phenomena in one eye. Some patients have it in both eyes, and some patients have it in a single eye. I have data that's tracking a certain eye phenomena.