currently my data set looks like this:
. dataex p_wine_on gor year
----------------------- copy starting from the next line -----------------------
There are 7 Gor groups which stand for government region. At the moment my p_wine_on (price for wine on trade) variable only varies with year (there are 6 years). However i want to replace the p_wine_on for different gor groups within the years
e.g at the moment for all Gor groups in 2007 price of wine on trade is 1.825 but now i want it to be different for each 7 groups and this is the case for every year. There are 6 years in the study
How shall i do this?
I have tried using the following code:
but it says invalid syntax
. dataex p_wine_on gor year
----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float p_wine_on byte gor int year 2.385 3 2012 2.385 3 2012 2.385 2 2012 2.385 3 2012 2.385 3 2012 2.385 2 2012 2.385 4 2012 2.385 4 2012 2.385 3 2012 2.385 2 2012 2.385 3 2012 2.385 2 2012 2.385 3 2012 2.385 4 2012 2.385 4 2012 2.385 5 2012 2.385 4 2012 2.385 2 2012 2.385 6 2012 2.385 4 2012 2.385 2 2012 2.385 6 2012 2.385 3 2012 2.385 3 2012 2.385 3 2012 2.385 4 2012 2.385 2 2012 2.385 3 2012 2.385 4 2012 2.385 3 2012 2.385 2 2012 2.385 3 2012 2.385 6 2012 2.385 6 2012 2.385 2 2012 2.385 3 2012 2.385 2 2012 2.385 4 2012 2.385 4 2012 2.385 3 2012 2.385 4 2012 2.385 6 2012 2.385 3 2012 2.385 3 2012 2.385 3 2012 2.385 3 2012 2.385 3 2012 2.385 4 2012 2.385 3 2012 2.385 4 2012 2.385 7 2012 2.385 3 2012 2.385 4 2012 2.385 2 2012 2.385 2 2012 2.385 3 2012 2.385 2 2012 2.385 4 2012 2.385 6 2012 2.385 7 2012 2.385 4 2012 2.385 6 2012 2.385 2 2012 2.385 1 2012 2.385 2 2012 2.385 1 2012 2.385 5 2012 2.385 3 2012 2.385 3 2012 2.385 3 2012 2.385 4 2012 2.385 3 2012 2.385 4 2012 2.385 2 2012 2.385 2 2012 2.385 5 2012 2.385 3 2012 2.385 4 2012 2.385 3 2012 2.385 1 2012 2.385 3 2012 2.385 3 2012 2.385 4 2012 2.385 3 2012 2.385 3 2012 2.385 2 2012 2.385 3 2012 2.385 1 2012 2.385 1 2012 2.385 1 2012 2.385 2 2012 2.385 2 2012 2.385 2 2012 2.385 4 2012 2.385 3 2012 2.385 4 2012 2.385 3 2012 2.385 3 2012 2.385 4 2012 2.385 2 2012 end label values gor Gorx label def Gorx 1 "North East", modify label def Gorx 2 "North West & Merseyside", modify label def Gorx 3 "Yorkshire and the Humber", modify label def Gorx 4 "East Midlands", modify label def Gorx 5 "West Midlands", modify label def Gorx 6 "Eastern", modify label def Gorx 7 "London", modify
There are 7 Gor groups which stand for government region. At the moment my p_wine_on (price for wine on trade) variable only varies with year (there are 6 years). However i want to replace the p_wine_on for different gor groups within the years
e.g at the moment for all Gor groups in 2007 price of wine on trade is 1.825 but now i want it to be different for each 7 groups and this is the case for every year. There are 6 years in the study
How shall i do this?
I have tried using the following code:
Code:
replace p_wine_on = 1.9564 if gor=1 & year=2007
Comment