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
Paneldata regression with a loopDear all, I am using Stata MP 16.1. For my masterthesis I want to obtain elasticities for sector x …
two way fixed effects: Mundlak specification (time effects and fixed effects)Dear all, I am working with panel data and would like to proceed with a two-way fixed effects model:…
Counting yearly cumulative observationsHi all! I am working with the dataset in the attachment. The data in the variable appln_id are Amer…
Create variable that calculates difference in matched observation and "normal observation" of a variableHi all, For my thesis I need to extract the difference in Issue Yield between green bonds and conve…
Import XML data with Stata - usexmlexDear Stata community, does anyone know how to import xml-data with Stata Version 16? I tried to in…
Subscribe to:
Post Comments (Atom)
0 Response to Calculating an average that doesnt include missing values
Post a Comment