<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to get best correlation among different transformations of a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/446678#M112116</link>
    <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I want to get different transformations of independent variables(X variables) and find the best correlation among them with dependent variable( Y variable).&lt;/P&gt;&lt;P&gt;Suppose var1 is first variable..then take,,&lt;/P&gt;&lt;P&gt;-log(var1)&lt;/P&gt;&lt;P&gt;-exp(var1)&lt;/P&gt;&lt;P&gt;-sqrt(var1)&lt;/P&gt;&lt;P&gt;-square(var1) and&amp;nbsp;&lt;/P&gt;&lt;P&gt;-var1 (without transformation).&lt;/P&gt;&lt;P&gt;then find best correlation among each of these with Y variable..Repeat this for var2,var3...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here age,ed,income are X variables and ln_totalspent is Y variable.(in attached dataset)&lt;/P&gt;&lt;P&gt;Please help me guys to automate this ....&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 07:23:25 GMT</pubDate>
    <dc:creator>Arjun_C</dc:creator>
    <dc:date>2018-03-19T07:23:25Z</dc:date>
    <item>
      <title>how to get best correlation among different transformations of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/446678#M112116</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I want to get different transformations of independent variables(X variables) and find the best correlation among them with dependent variable( Y variable).&lt;/P&gt;&lt;P&gt;Suppose var1 is first variable..then take,,&lt;/P&gt;&lt;P&gt;-log(var1)&lt;/P&gt;&lt;P&gt;-exp(var1)&lt;/P&gt;&lt;P&gt;-sqrt(var1)&lt;/P&gt;&lt;P&gt;-square(var1) and&amp;nbsp;&lt;/P&gt;&lt;P&gt;-var1 (without transformation).&lt;/P&gt;&lt;P&gt;then find best correlation among each of these with Y variable..Repeat this for var2,var3...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here age,ed,income are X variables and ln_totalspent is Y variable.(in attached dataset)&lt;/P&gt;&lt;P&gt;Please help me guys to automate this ....&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 07:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/446678#M112116</guid>
      <dc:creator>Arjun_C</dc:creator>
      <dc:date>2018-03-19T07:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to get best correlation among different transformations of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/456590#M115661</link>
      <description>&lt;P&gt;Initially correlation analysis is done then logistic regression is used for predictive analysis. Model will predict high spenders based on age and income with 95% confidence limits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
DATA S;
SET S;
/*representing variable ln_totalspent with binary values
IF ln_totalspent &amp;gt; 5.5 then it will be considered High Spender
*/
HighSpender=IFC( ln_totalspent &amp;gt; 5.5, 1 ,0,.);
Run;

/*data normalized*/
 proc standard data=S mean=0 std=1 out=zCrRisk; 
 var age ed income; 
 run; 

/*finding co-relation*/
 proc corr data=zCrRisk ; 
 var age ed income; 
 run;

/*principle component analysis*/

 proc princomp data=zCrRisk out=princout; 
 var age ed income; 
 run;

 proc factor data = zCrRisk method = principal rotate = quartimin score  
 mineigen=1 nfactors=2  residuals eigenvectors out=factout outstat=fact; 
 	var age ed income; 
run;

/*Predictive modeling based on key factors */

/*Spliting S dataset into Training and Testing Dataset for Modeling*/
proc surveyselect data=factout samprate=0.60 seed=201 out=jk outall  
 method=srs noprint; 
 run; 
 
 data training testing; 
 set jk; 
 if selected = 1 then output training; 
 else output testing; 
 drop selected; 
 run;


ods graphics on; 
proc fastclus data=Factout maxc=2 maxiter=10 out=clus; 
    var Factor1 Factor2 ; 
run; 
 
proc freq; 
    tables cluster*HighSpender; 
run; 
 
proc candisc ncan = 2 out=can; 
    class cluster; 
    var Factor1 Factor2; 
    title3 'Canonical Discriminant Analysis of Clusters'; 
run; 
 

proc sgplot data= can; 
    scatter y=Can2 x=Can1 / group=cluster; 
    title3 'Plot of clusters'; 
run; 
 
dm "odsresults; clear"; 


proc discrim data=Training anova all distance outstat = dis method = normal pool=yes testdata = Testing TESTout = LDA_Out  
 crossvalidate outcross = cross1 mahalanobis posterr; 
 	priors equal ; 
 	class HighSpender; 
 	var Factor1 Factor2 ; 
run;

ods graphics on; 
proc logistic data=TESTING outest=betas covout plots(only)=(roc(id=obs) effect); 
  model HighSpender(event = '1') = age ed income 
 					/ selection=stepwise 
                      slentry=0.3 
                      slstay=0.35 
                      details 
                      lackfit; 
  output out=pred p=phat lower=lcl upper=ucl 
         predprob=(individual crossvalidate); 
run; 
ods graphics off; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Apr 2018 16:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/456590#M115661</guid>
      <dc:creator>emrancaan</dc:creator>
      <dc:date>2018-04-23T16:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to get best correlation among different transformations of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/456612#M115670</link>
      <description>&lt;P&gt;Look at the BOXCOX transformation of PROC TRANSREG. Repeat for each Y variable.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Apr 2018 17:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-get-best-correlation-among-different-transformations-of-a/m-p/456612#M115670</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-04-23T17:19:42Z</dc:date>
    </item>
  </channel>
</rss>

