BookmarkSubscribeRSS Feed
Shakti_Sourav
Quartz | Level 8

Hy,

I want to calculate by formula instead of using Proc Factor and Proc Score in SAS EG.

I want CSAT score from avbailable Varibales i.e positive behaviour, positive bribe and positive service,

i have attached one examnple by the name of Example1 and Example 2

 

help me what will be the formula to get this score

 

 

Thank You

ShaktiExample1Example1Example2Example2my dataset like this, and i have to calculate CSAT Score by taking of these 3 variables and CSAT score must be under 80%my dataset like this, and i have to calculate CSAT Score by taking of these 3 variables and CSAT score must be under 80%

12 REPLIES 12
PaigeMiller
Diamond | Level 26

What exactly is the problem with the code you are showing? Why isn't PROC SCORE sufficient in this case?

--
Paige Miller
Shakti_Sourav
Quartz | Level 8

Proc factor and Proc score both are not accessible in my system.

Shakti_Sourav
Quartz | Level 8

I just want formula instead of proc score and Proc factor

PaigeMiller
Diamond | Level 26

So what is wrong with the formula you typed?

--
Paige Miller
Shakti_Sourav
Quartz | Level 8

which formula calculate the factor. I have used that Varibales-(mean(Variables)/Std). is it calculating the Factor/Score?

Zard
SAS Employee

You probably need to center the raw data as well. See if this helps:

 

title 'PROC FACTOR';
proc factor data=sashelp.class method=prin nfact=2 outstat=outstat out=out ;
var height weight;
run;
proc print data=out;
run;

title 'PROC SCORE';
/*The PROC SCORE statement does not contain the NOSTD option,
so the data in the input data set are standardized before scoring.*/
proc score data=sashelp.class score=outstat out=scored;
var height weight;
run;
proc print data=scored;
run;


title 'BY HAND';
proc print data=outstat;
run;
/*
Obs _TYPE_ _NAME_ Height Weight
1 MEAN 62.3368 100.026
2 STD 5.1271 22.774
3 N 19.0000 19.000
4 CORR Height 1.0000 0.878
5 CORR Weight 0.8778 1.000
6 COMMUNAL 1.0000 1.000
7 PRIORS 1.0000 1.000
8 EIGENVAL 1.8778 0.122
9 PATTERN Factor1 0.9690 0.969
10 PATTERN Factor2 0.2472 -0.247
11 SCORE Factor1 0.5160 0.516
12 SCORE Factor2 2.0227 -2.023
*/

data scores_by_hand;
set sashelp.class;
MeanHeight= 62.3368 ;
MeanWeight=100.026 ;
StdHeight=5.1271;
StdWeight= 22.774 ;
F1_StdScoringCoeff_Height=0.51601467;
F1_StdScoringCoeff_Weight=0.51601467;
F2_StdScoringCoeff_Height=2.02266093;
F2_StdScoringCoeff_Weight=-2.02266093;
Factor1=F1_StdScoringCoeff_Height*(Height-MeanHeight)/StdHeight +
F1_StdScoringCoeff_Weight*(Weight-MeanWeight)/StdWeight ;
Factor2=F2_StdScoringCoeff_Height*(Height-MeanHeight)/StdHeight +
F2_StdScoringCoeff_Weight*(Weight-MeanWeight)/StdWeight ;
drop MeanHeight MeanWeight StdHeight StdWeight
F1_StdScoringCoeff_Height F1_StdScoringCoeff_Weight
F2_StdScoringCoeff_Height F2_StdScoringCoeff_Weight ;
run;
proc print data=scores_by_hand;
run;

 

 

Shakti_Sourav
Quartz | Level 8

Thank You

 

But How to calculate by formula of F1_StdScoringCoeff_Height and F1_StdScoringCoeff_Weight ??

Shakti_Sourav
Quartz | Level 8

I don't have access for SAS/STAT. that's why I am Unable to use Proc Factor and Proc score. So I want to do by Formula instead of Proc factor and proc score. 

SteveDenham
Jade | Level 19

I don't understand.  Your first post shows output from PROC FACTOR, so someplace along the line it was available.  Could you explain your situation further?

 

SteveDenham

Shakti_Sourav
Quartz | Level 8

Hy,

other system have access Proc factor. but in my system don't have an access of SAS/STAT. so I want to calculate by formula..

 

Thank you

Zard
SAS Employee

I misunderstood the question. Let me regroup...

Zard
SAS Employee

If you want to derive the factor scoring coefficients outside of SAS, you would still need a matrix algebra software package. Here is an example (which I did not write) using PROC IML:

 

proc corr data=sashelp.class outp=corr;
var age height weight;
run;

proc factor data=corr method=prin;
ods select eigenvalues;
run;


proc iml;
R= {1.0000 0.8114 0.7409,
0.8114 1.0000 0.8778,
0.7409 0.8778 1.000};
priors={1 1 1};
d=diag(priors);
r1 = R-i(3) +d;
print r r1;
call eigen(e1,e2,r1);
print e1;
quit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 12 replies
  • 826 views
  • 0 likes
  • 4 in conversation