Hello,
I am doing a secondary data analysis of pre and post-surveys for a falls prevention program. There are 427 pre and post surveys, and each pre- and post-survey notes the # of times fallen in the past three months. I am trying to create a % change variable for each observation based on the TimesFallen_pre and TimesFallen_post variables.
I tried creating the variable by using this code:
gen ReducFalls_percent = (TimesFallen_post - TimesFallen_pre)/TimesFallen_pre
However, I the result is 417 missing values. Many of the participants recorded 0 falls on the pre-survey and 0 falls on the post-survey, so I think my issue is that 0 is being treated as missing? Or the gen command won't divide by 0?
If someone could please help me figure out the correct code to create a % change variable for each observation, that would be awesome.
Thank you
Related Posts with Creating Percent Change Variable
Export bootest resutls for a number of regressions.Hello, I am using running a simple regression, in a context with few clusters. For robust inference,…
Asymmetric predictors in dynamic panel models?Hi all, In a longitudinal analysis, I suspect that the impact of an increase in a predictor variabl…
Calculate the standard deviation of multiple variable at once.Hello, I would like to calculate the mean and the standard deviation of multiple variable at once I…
Problem graphing by several variablesHello ! My name is Hans Huber and I was wondering if someone could help me making a certain type of…
Problem graphing by many variablesHello ! My name is Hans Huber and I was wondering if someone could help me making a certain type of…
Subscribe to:
Post Comments (Atom)
0 Response to Creating Percent Change Variable
Post a Comment