BookmarkSubscribeRSS Feed
Harman
Calcite | Level 5

Hi,

 
I was performing Linear Regression which is based on E-Commerce Dataset. I was stuck with the following problem.
 
Assumption: In the dataset, I am taking store_purchase_event_count as a Dependent variable for predicting store_purchase_event_count using OLS Linear Regression.
 
Problem: I am trying to Normalize the Dependent variable but it contains more than 50-60% of zeroes. So, I was not able to figure out how I should move forward with this problem.
 
Solutions tried: 
1. Added constant to each value of Y and then taking the log.
2. Taking the square root of each value.
 
None of the above solutions is making Y variable normal. Please suggest how to move forward
2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Moved question to " SAS Statistical Procedures"

StatDave
SAS Super FREQ

I assume that your response is positively valued except for the zeros. If that is correct, and if the values are all integers (like a count: 0, 1, 2, 3, ...), then you can fit a zero-inflated Poisson or negative binomial model using PROC GENMOD. See the GENMOD documentation. If the response is positive and continuous, then you could try fitting a zero-inflated gamma model using PROC FMM - for example: 

 

data a; 
call streaminit(2342);
do i=1 to 100;
 y=rand("gamma",2);
 output;
end; 
do i=1 to 10; y=0; output; end;
run;

/* histogram of data */
proc sgplot data=a;
histogram y / showbins nbins=9;
run;

/* zero-inflated gamma model */
proc fmm data=a plots=density(nbins=9);
model y= / dist=gamma;
model + / dist=constant;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1969 views
  • 1 like
  • 3 in conversation