Guanhua Lu’s Web Notes

October 28, 2009

Log Transformation, Additive and Multiplicative

Filed under: SAS — Tags: , , , — guanhualu @ 10:33 am

For Left skewed data, the most popular way to handle it is to apply log transformation and then do some bias adjustment. The log transformation transforms skewed data to normal-like data. But it also trnasforms additive model (linear) to multiplicative model. At some time, we need to apply log transformation, meanwhile we prefer the additive form instead of multiplicative. Generalized Linear Model with self-determined deviance and link function is a good choice. The following is an example by using PROC GENMOD.

proc genmod data=model_data2;
  where origdte1 > “&cutoff_dt”d or mtm_sale1 = .;
  class tract
        no_bath
        prior_qtr
        curr_qtr
        /param=GLM;
  mu = _MEAN_;
  y = _RESP_;
  d = ( y – mu )**2;
  variance var = mu;
  **variance var = mu**2;
  deviance dev = d; 
  fwdlink link = exp(_MEAN_);
  invlink ilink = log(_XBETA_);
  model log_sale = mtm_sale2*prior_qtr
                assd_total
                no_bath
                sf_total_1 – sf_total_3
                lot_size_1 – lot_size_3
                bldg_age_1 – bldg_age_3                  
                tract
                curr_qtr
                / NOINT
                ;
  output out=mydata.hybrid_norm_log_out p=pred;
quit;

Create a free website or blog at WordPress.com.