BookmarkSubscribeRSS Feed
smcelroy
Calcite | Level 5

Hello Everyone!

I am trying to create a wealth index using the eigenvectors obtained from a principal component analysis and multiple other variables. My data looks like this 

Dataset 1:                       Dataset 2:

 

Prin1                                   ID         V1     V2    V3     V4     V5     V6   V7 ....(other variables that are not related but I need to keep)

.23                                       1

.43                                       2

.62                                       3

.12                                       4

.09                                       5

.67                                       6

.82                                       7

 

I would like to calculate      INDEX=0.23(V1)+.43(V2)+.62(V3)+.12(V4)+.09(V5)+67(V6)+.82(V7)

So I would like to multiply the first observation of dataset 1 by the entire column V1 of dataset 2 and repeat this for all the observations in dataset 1.

 

1 REPLY 1
Reeza
Super User

This is known as scoring a data set. Look at PROC SCORE and I believe the example section has one specifically on using Factors /principal components/eigenvectors. 

 

http://documentation.sas.com/?docsetId=statug&docsetTarget=statug_score_examples01.htm&docsetVersion...


@smcelroy wrote:

Hello Everyone!

I am trying to create a wealth index using the eigenvectors obtained from a principal component analysis and multiple other variables. My data looks like this 

Dataset 1:                       Dataset 2:

 

Prin1                                   ID         V1     V2    V3     V4     V5     V6   V7 ....(other variables that are not related but I need to keep)

.23                                       1

.43                                       2

.62                                       3

.12                                       4

.09                                       5

.67                                       6

.82                                       7

 

I would like to calculate      INDEX=0.23(V1)+.43(V2)+.62(V3)+.12(V4)+.09(V5)+67(V6)+.82(V7)

So I would like to multiply the first observation of dataset 1 by the entire column V1 of dataset 2 and repeat this for all the observations in dataset 1.

 


 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 712 views
  • 0 likes
  • 2 in conversation