I have data in a dataframe with the following columns: date, time, symbol, price I am attempting to run the following model in R
price ~ factor(time) + factor(symbol)*factor(time) + 0
where the first coefficient comes from a dummy variable of the time column in the dataframe and the second coefficient comes from the product of the dummy variable of the time column and the symbol column. I used lm() to attempt to do the model.
fit<-lm(price~factor(time) + factor(symbol)*factor(time) + 0, data=mydata)
However, that didn't work as it gets me some really weird coefficients that didn't say anything. I guessing as that was matching effects in some way and not just the straight forward product. I tried making a new variable by multiplying the product of the factors and then putting it in the regression but that didn't work as r told me that * is not in the possible operations for factor(). So, how can you multiply two factors in a linear regression? Your help is much appreciated, thank you in advance.
edit: when I say weird I guess I should more say not what I want. I get coefficients for the firm, then coefficients for time then coefficients for firm and time. However, I only want the coefficients for firm and time to impact the model and ultimately I am really interested in what this does to the intraday effects which are approximated using the time dummy variables. If I am getting the interaction effects of the firm, time and then firm and time then this will impact the first coefficient as opposed to only firm and time affecting the first coefficient?