Dear folks,
I am currently working on a dataset that contains sales data of items in stores across the country. Each row represents a purchase and contains information on the amount of product name, product brand, units sold, unit price, date, store name, store brand, state of store, etc. For the sake of price analysis, I am currently trying to create a mean price across the whole observational period. However, as prices obviously differ across brands, store types and time, one has to create several individual means that control for each of these variable specifications.
More precisely:
I want Stata to create individual mean prices for each of all observations that share:
The same product (variable 1)
The same store type (variable 2)
The same state of store (variable 3)
The same week of purchase (variable 4)
The same year of purchase (variable 5)
I have some working knowledge with creating new variables, means, etc. in Stata. However, I haven't managed to do get it done if the mean depends on more than one variable as in the case above.
Many thanks in advance!
Related Posts with Generate mean depending on variable specification
Bivariat probit model using panel dataDear, I hope you are fine, maybe somebody know the command of a Bivariate using panel data structur…
Attention: Frank LobueBy my count Frank Lobue -- which may be the name of a collective as one Anthony Santana sent me a re…
Merging two rowsHi, I've dataset like this: Code: * Example generated by -dataex-. To install: ssc install dataex …
Coding for one relationship (Add Health WIV). Dropping people with the shortest relationship duration.I am using Wave IV of Add Health, and I am trying to get one partner among all of the relationships …
psmath2 and rbounds: estimating 'interaction effect' using Propensity Score Matching, and the sensitivity analysisHello, I'm using Propensity Score Matching method to estimate a treatment effect (psmatch2 used). On…
Subscribe to:
Post Comments (Atom)
0 Response to Generate mean depending on variable specification
Post a Comment