Combining data for analysis

Hey guys,

I am not entirely sure how to explain this but I am trying to only use data with certain inputs so that I may make a regression. Specifically, I want to regress "Price" on "Italy" from the year "2011", then compare that regression with other countries and years to see how the inputs would vary price.

The column "Italy" shows TRUE for each row that was made from Italy.

My question is, how can I code so that I can regress "Price" on the country of Italy and the Year of 2011?

Note there's 8666 observations in this data set, all ranging from years 1991-2012 and with about 16 different countries of which these bottles of wine were made.

Data: Red.csv

Something like

lm(price ~ (year == 2011) + Italy, data = red)

?

1 Like

Yes that was it! Thank you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.