Hello,
I have data involving auctions and contracts. My task is to find the average of the winning bids. So, I used this code to get a formula for the max bid by contract:
egen maxbid= max(bid), by(contractnum).
My problem is that the values for maxbid are repeated every time a certain contract is mentioned. For example, contract 08-492904 has 7 bidders, so the winning bid is listed 7 times. As you can see, this would create incorrect values for the mean if I did sum maxbid. So, how can I fix this error?
Related Posts with Finding a mean when values are repeated
Marginal Effects on ivprobitI'm running an ivprobit model, and I'm trying to get marginal effects out of the second stage coeffi…
Calculating BMI when ht and wt have been recorded with different unitsHello, I am trying to create a new variable for BMI and I have a dataset with continuous variable "…
IV regression with multiple interactionsHello, I hope you could help me with this. I need to estimate three separate equations with -ivreg2…
Re-arrange variablesDear all, I have 30 variables in different columns. Now I want Stata to generate one new variable w…
Combining two variablesHello, i'm just working on a do-file and I'm struggeling to combine to variables. The first variable…
Subscribe to:
Post Comments (Atom)
0 Response to Finding a mean when values are repeated
Post a Comment