First, get your oil prices.
Second, check that you got good data.
Maybe get the data somewhere else and see if they match well enough.
Third, define what you mean by "demand shock" and "supply
shock".>From the definitions I found at Invesopedia,
it's not clear that you *can* tell a supply shock from a demand
shock if all you have is prices.
If the price goes up (or down) unexpectedly, that could be either a supply
shock -- less (or more) supply -- or a demand shock more (or less) demand.
You need something else to tell them apart.
What is that?
Now a shock of this kind is defined as an *unexpected* change.
So you have to figure out how to predict price changes.
Here we have to distinguish between transient shocks, external events whose
effects dissipate so that the system returns to its previous behaviour, and
structural shocks, where your previous predictive models lose validity
because the system to be modelled has changed. What are you looking for?
What kind of predictive model do you have in mind? How do you expect it to
change when a producer enters or leaves the market, or a consumer enters or
leaves the market?
All of this hard thinking has to happen before you worry about things like
whether the R package strucchange will do what you want. (I don't think it
will.)
On Thu, 30 Jun 2022 at 18:15, Muhammad Zubair Chishti <
mzchishti at eco.qau.edu.pk> wrote:
> Dear Experts,
> I hope that you are doing well. Kindly help me how to estimate demand and
> supply shocks of oil prices in R?
>
> Regards
> Muhammad Zubair Chishti
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
[[alternative HTML version deleted]]