BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tommac72584
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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;

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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;
Tommac72584
Fluorite | Level 6

Perfect. Thank you Rick. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1475 views
  • 1 like
  • 2 in conversation