Page 1 of 1

near singular matrix error

Posted: Thu Oct 24, 2024 12:19 pm
by BT454
Hi all!
I'm attempting to create a forecast of expected values to compare to actuals from a post-treatment period. However, I'm receiving a near singular matrix error. I'm almost certain this is caused by all the dummy variables I'm using (dom = day of month, moy = month of year, dow = day of week, mft = dummy variable for treatment). Please note: I've dropped an observation from each dummy variable in attempt to avoid perfect collinearity, but I don' think it worked.

I would like to estimate and evaluate the forecast over two time periods:
1. Pre-treatment estimation, pre-treatment evaluation: hoping this will allow me to use my t-stat on the treatment dummy variable to gauge the confidence intervals, and also back-test the forecast
2. Pre-treatment estimation, post-treatment evaluation: comparing the forecasted expected values to the actual values of the treatment period to quantify the impact of the treatment.

Please see the workfile below, containing the equation i'm attempting to estimate.
Thanks!
Bob

Re: near singular matrix error

Posted: Thu Oct 24, 2024 1:43 pm
by EViews Gareth
How did you drop dummies?

Re: near singular matrix error

Posted: Thu Oct 24, 2024 3:40 pm
by startz
The equation post_MRC_eq, which I recognize may not be what you used, does not have dummies dropped.

Re: near singular matrix error

Posted: Fri Oct 25, 2024 9:16 am
by BT454
How did you drop dummies?
I picked one observation set for each of the period/time variables and made it a 0
for instance:
smpl @all
series moy = @month 'generate moy series
smpl if @month = @2
series moy = 0 'drop all february observations by setting to 0

would this work?

Re: near singular matrix error

Posted: Fri Oct 25, 2024 9:18 am
by EViews Gareth
No. Setting a dummy variable to zero is not removing it.

Re: near singular matrix error

Posted: Fri Oct 25, 2024 9:46 am
by BT454
No. Setting a dummy variable to zero is not removing it.
Fair :)

I have attempted many different functional forms including dropping several of the variables altogether (not just dropping observations), but I still receive the same near singular matrix error, if I have a second dummy variable along with MFT (capturing the treatment period).

Is this because at some point the included explanatory variables are all equal to the same value (1, 0, etc)?

Re: near singular matrix error

Posted: Sat Oct 26, 2024 7:55 am
by startz
If you have two variables with identical values for every given observation, then that's the problem. After all, if the two are always the same how can the computer separate out their effects?

Re: near singular matrix error

Posted: Mon Oct 28, 2024 6:51 am
by BT454
If you have two variables with identical values for every given observation, then that's the problem. After all, if the two are always the same how can the computer separate out their effects?
Ok. That shouldn't be the case for any of the variables. They will share the same values for some observations, but not all. I'll double check tho.
Thanks for the input!