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
interpreting interaction effects continuous by categorical variablesHi all, I am having difficulty to interpret interaction effects. I watched some videos and read for…
Nationwide inpatient sampleHi everyone, I started to learn STATA for my NIS data analysis recently. I have no experience of us…
Adjusting the Scale of Cluster GraphHey everybody, I am currently conducting a cluster analysis in Stata and I have a small problem. As…
Problem with asdoc table 3 wayHi all, I am continually having problem with the results with asdoc in a table 3 way, example: Co…
Dividing data into periods and then groupsHi! I want to divide my panel data into different cross-sectional data of each group, and then divi…
Subscribe to:
Post Comments (Atom)
0 Response to Generate mean depending on variable specification
Post a Comment