Dependent variable has no variance - Logit regression

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

fr4014
Posts: 8
Joined: Fri Apr 29, 2022 1:50 pm

Dependent variable has no variance - Logit regression

Postby fr4014 » Sat Apr 30, 2022 3:30 pm

Hello,

I am running a logit regression with over 90000 observations. The dependent variable is a binary variable that takes the value 1 or 0. The sample has only 115 positive cases (dependent variable = 1). When I estimated the equation, it gave me a "Dependent variable has no variance". Some resources suggest expanding the data sample. However, the dataset only has 135 positive cases of default cases per 500,000 observations. This leads me to believe that there aren't any significant benefits in expanding the data sample. I also checked if the data had any variable listed as "NA" based on other thread on this website. It had one observation as NA, and I edited. However, the issue still persists. In addition, I have read the online guide, and it states that "First, you may get the error message “Dependent variable has no variance.” This error means that there is no variation in the dependent variable (the variable is always one or zero for all valid observations). This error most often occurs when EViews excludes the entire sample of observations for which takes values other than zero or one, leaving too few observations for estimation.
You should make certain to recode your data so that the binary indicators take the values zero and one. This requirement is not as restrictive at it may first seem, since the recoding may easily be done using auto-series. Suppose, for example, that you have data where takes the values 1000 and 2000. You could then use the boolean auto-series, “y=1000”, or perhaps, “y<1500”, as your dependent variable.

I m not sure I understand how this is to be done in my case. Since in my case, the values are 1 and 0 and they are very unbalanced as there are only 115 values of one and the rest of the observations out of 90000 are zero. What should the command be? Is this the following command correct? If not, please provide step by step instructions.

boolean autoseries, y=1

Thankyou

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dependent variable has no variance - Logit regression

Postby EViews Gareth » Sat Apr 30, 2022 3:50 pm

What happens if you reduce the sample dramatically, keeping the 115 1s, but only including, say, 1500 0s?
Follow us on Twitter @IHSEViews

fr4014
Posts: 8
Joined: Fri Apr 29, 2022 1:50 pm

Re: Dependent variable has no variance - Logit regression

Postby fr4014 » Sat Apr 30, 2022 5:16 pm

Hi,

Thank you for your response. I cant reduce the size, 115 positive cases are distributed across my current sample size. In fact, the first positive case of y=1 is at 11000th observation.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dependent variable has no variance - Logit regression

Postby EViews Gareth » Sat Apr 30, 2022 5:20 pm

Just choose the first 1500 observations plus any observations where y=1.

Code: Select all

smpl @all if @trend<1500 or y=1
Follow us on Twitter @IHSEViews

fr4014
Posts: 8
Joined: Fri Apr 29, 2022 1:50 pm

Re: Dependent variable has no variance - Logit regression

Postby fr4014 » Sat Apr 30, 2022 5:40 pm

Hi,

But I have chosen a period for the data sample - 2 years. So, wouldn't following this approach negate that. 8 have another hypothesis in the same study that I tested with the 2 years sample.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: Dependent variable has no variance - Logit regression

Postby EViews Gareth » Sat Apr 30, 2022 6:17 pm

Perhaps. I’m just trying to figure out if it is a calculation issue or a data issue
Follow us on Twitter @IHSEViews

fr4014
Posts: 8
Joined: Fri Apr 29, 2022 1:50 pm

Re: Dependent variable has no variance - Logit regression

Postby fr4014 » Sat Apr 30, 2022 11:31 pm

Hi,

I just played around with the variables and tried making some variables as dummy variables (loan to value % and loan term(short term & long term)) and left the rest 2 variables that were in % as quantitative. In addition, I also generated a series and named it y=default status. I m not sure how, but I got the regression results after doing this. I have attached a screenshot. However, Mcfadden r squared is only 0.10. Is this because it is the log likelihood? I had 2 other variables that I wanted to add but it gives me a "quasi separate completion error".
Attachments
sitg.png
sitg.png (24.65 KiB) Viewed 3741 times

startz
Non-normality and collinearity are NOT problems!
Posts: 3775
Joined: Wed Sep 17, 2008 2:25 pm

Re: Dependent variable has no variance - Logit regression

Postby startz » Sun May 01, 2022 7:11 am

One possibility is that in the original specification there was a lot of missing data for the right hand side variables, eliminating all the 1's.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 25 guests