I have data that looks like this
input str43 name float(dummyfrequency11 dummyfrequency12 dummyfrequency13 dummyfrequency14 dummyfrequency15)
"Adur District Council" 0 0 . . .
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Allerdale Borough Council" 0 0 . 0 0
"Amber Valley Borough Council" 1 1 . 1 1
"Amber Valley Borough Council" 1 1 . 1 1
"Amber Valley Borough Council" 1 1 . 1 .
"Amber Valley Borough Council" 1 1 . 1 1
"Amber Valley Borough Council" 1 1 . 1 1
"Amber Valley Borough Council" 1 1 . 1 1
"Amber Valley Borough Council" 1 1 . 1 0
"Amber Valley Borough Council" 1 1 . 1 1
"Amber Valley Borough Council" 1 1 . 1 0
"Amber Valley Borough Council" 1 1 . 1 0
"Amber Valley Borough Council" 1 1 . 1 0
"Amber Valley Borough Council" 1 1 . 1 .
"Amber Valley Borough Council" 1 1 . 1 .
"Amber Valley Borough Council" 1 1 . 1 1
I would like to find the average for each row, however I dont want the average to include the missing values, nor include them in the n on the bottom.
For example the values I want for the bottom 4 columns would be
0.75,1,1, and 1.
Doing this manually would take far too long as I have many more columns of dummies and many more rows.
Any help is greatly appreciated! Thank You.
Related Posts with Calculating an average that doesnt include missing values
Creating Probability VariablesHi, I have a set of variables indicating whether there was a recession in your year of birth or not…
Fitstat gives error messageHi all, When I use fitstat after a ologit regression, I get this message: Code: . fitstat Measur…
How to use if statement in foreach loop?I'm attempting to plot gas concentrations over time, but want to format the graphs differently for s…
Legend option in Graph barDear All, I want to make a graph bar over a categorical variable (4 categories). My data looks as f…
Family Fixed Effects with large number of fixed effectsHi Everyone, I am trying to run family fixed effects. I have a ton of mother ids to identifiy where…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating an average that doesnt include missing values
Post a Comment