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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 2613 views
  • 1 like
  • 3 in conversation