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
All variables are insignificantHello, I am working on a time series data of a specific country, I followed the steps of time series…
Best practices for diff-in-diffHi, I'm working on a reverse diff-in-diff analysis on sentencing after a circuit split was resolved …
Different results while working with stata in windows and macHi All, I've recently started working on Stata (13.1) on a mac system, and I'm getting different re…
Interactions of an Endogenous and Exogenous VariableHello, We are running the following regression: Y = aX1 + bX2 + cX1#X2 + `XVars' + error Our depe…
Analysis of Ranked VaribalesDear All, I need some help in analyzing my ranked variables. In my survey I asked to select the top…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating an average that doesnt include missing values
Post a Comment