I imported the data as followed:
/* Generated Code (IMPORT) */
/* Source File: Hatco x1-x7.txt */
/* Source Path: /home/tmaciver7840/my_content */
/* Code generated on: Friday, June 24, 2016 3:56:21 PM */
%web_drop_table(WORK.IMPORT4);
FILENAME REFFILE "/home/tmaciver7840/my_content/Hatco x1-x7.txt" TERMSTR=CR;
PROC IMPORT DATAFILE=REFFILE
DBMS=tab
OUT=WORK.IMPORT4;
GETNAMES=YES;
RUN;
PROC CONTENTS DATA=WORK.IMPORT4; RUN;
%web_open_table(WORK.IMPORT4);
I'm good up to this point. Now I just need a little help with running a factor analysis. I appreciate any guidance. Thank you.
There are many kinds of factor analysis. The simplest is probably the principal component analysis. The documentation for PROC FACTOR has a Getting Started example and four other helpful examples. A basic call might look like this:
ods graphics on;
proc factor data=import4 corr n=4 score outstat=ScoreOut
method=prin rotate=varimax plots=all;
var x1-x7;
run;
If you want to produce factor scores, you can use PROC SCORE to score the model and use PROC SGPLOT to plot the results:
proc score data=import4 score=ScoreOut out=FactorScores;
var x1-x7;
ID ID;
run;
proc sgplot data=FactorScores;
scatter x=Factor1 y=Factor2 / datalabel=ID;
xaxis grid;
yaxis grid;
refline 0 / axis=x; refline 0 / axis=y;
run;
There are many kinds of factor analysis. The simplest is probably the principal component analysis. The documentation for PROC FACTOR has a Getting Started example and four other helpful examples. A basic call might look like this:
ods graphics on;
proc factor data=import4 corr n=4 score outstat=ScoreOut
method=prin rotate=varimax plots=all;
var x1-x7;
run;
If you want to produce factor scores, you can use PROC SCORE to score the model and use PROC SGPLOT to plot the results:
proc score data=import4 score=ScoreOut out=FactorScores;
var x1-x7;
ID ID;
run;
proc sgplot data=FactorScores;
scatter x=Factor1 y=Factor2 / datalabel=ID;
xaxis grid;
yaxis grid;
refline 0 / axis=x; refline 0 / axis=y;
run;
Perfect. Thank you Rick.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.