Hi, I am attempting to filter rows of my dataframe 'AGE' based on a range of values of the variable 'SF35PCS_HLEQ1', and then find the mean of the remaining 'AGE2' variable rows. However, I keep getting the same mean value output despite changing the range of values. How can I rectify this issue so that the range limitation command is effected?
Hi, thank you for your suggestion. This method seems to work for some variables, and not for others. For instance, if I try and run the following code, I keep getting the same output for the mean of 'AGE', despite changing the cutoff for the 'DEMENTIA_COHORTDATE1' variable, suggesting that the 'DEMENTIA_COHORTDATE1 >=2004' command is not being applied: