I want to predict the impact of oil price over a Colombian oil company's stock price. I plan to use a logistic regression for this with a categorical variable (Up or Down given the direction of the stock price). Here is part of my dataset:
Minute ecopet profit sum_profit direccion cl1_chg sum_cl1 direccion_cl1
571 2160 0 10 Up -0.03 0.00 Down
572 2160 0 0 Neutral 0.07 -0.03 Down
573 2160 0 -5 Down -0.08 0.04 Up
574 2160 0 -5 Down -0.07 -0.04 Down
575 2160 5 -5 Down -0.08 -0.11 Down
576 2165 0 -25 Down 0.00 -0.19 Down
577 2165 0 -25 Down -0.05 -0.19 Down
578 2165 0 -15 Down -0.17 -0.24 Down
579 2165 5 -15 Down -0.06 -0.41 Down
580 2170 0 -20 Down 0.03 -0.47 Down
581 2170 -10 0 Neutral 0.04 -0.44 Down
My dependent variable is 'direccion'. But as you can see it has 3 response classes. I know that to implement a binary logistic regression in R the code is:
glm.fit=glm(direccion~direccion_cl1, data=datos, family=binomial)
I am working with intraday information and plan to predict what happens when the oil moves up/ down (in the previous 10 minutes) and how it impacts the stock price in the next 10 minutes.
Could anyone tell me how could I perform this? I don't really know how to perform the logistic regression with 3 response classes. Thanks!
multinom
function from thennet
: ats.ucla.edu/stat/r/dae/mlogit.htm $\endgroup$