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
Subjects with no failure event not in risk pool, StsetHello- I am using the following commands for my set of patients with multiple records and multiple …
How to estimate prevalences of an indicator over the years?Dear Statalist, My dataset presents the prevalence of a given indicator over 11 years (2007 to 2017…
Problems with the Esttab commandDear Stata community, I have currently an issue with the esttab command. I want to run a loop of re…
Problems with the Esttab commandDear Stata community, I have currently an issue with the esttab command. I want to run a loop of re…
Query in STATAHi, I have values in my variable (tax_threshold) with many "0" values. I want to replace all the "0…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating an average that doesnt include missing values
Post a Comment