Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8990873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:35:58+00:00 2026-06-15T22:35:58+00:00

I’m doing some PCA analysis for my data. and its my first time to

  • 0

I’m doing some PCA analysis for my data. and its my first time to try this type of analysis.
I’m having a matrix of a thousand columns and few thousands of rows, and i am trying to make a smaller matrix by getting rid of correlated variables (which are the columns in my case).
everything is going great until the moment, but i am unable to do the next step.
here’s an example to show my data.

         a1    a2    a3    a4    ....    a1000
item1    10    NA     5     3    ....
item2    0.01  0.5    NA   0.07  ....
item3    0.7   0.2    0.8  0.9   ....
                   .
                   .
                   .

I apply the princomp and get the following results

                         Comp.1     Comp.2     Comp.3     Comp.4     ...   Comp.1000
Standard deviation     24.1605431 7.31176669 5.96709553 3.56507807   ...
Proportion of Variance  0.7580933 0.06943108 0.04624186 0.01650621   ...
Cumulative Proportion   0.7580933 0.82752438 0.87376624 0.89027245   ...
                                       .
                                       .
                                       .

Now that i have computed everything…my question is: what command should i use to pick the uncorrelated components and paste them into a new matrix (or simply get rid of the correlated ones)?
how do i specify the range of correlation i want?

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:35:59+00:00Added an answer on June 15, 2026 at 10:35 pm

    I believe you are after the scores. From the help for ?princomp, the resulting object is a list that contains an elements scores:

    scores

    if scores = TRUE, the scores of the supplied data on the
    principal components. These are non-null only if x was supplied, and
    if covmat was also supplied if it was a covariance list. For the
    formula method, napredict() is applied to handle the treatment of
    values omitted by the na.action.

    Let’s set up an example (based on example in ?princomp):

    summary(pc.cr <- princomp(USArrests, cor = TRUE))
    Importance of components:
                              Comp.1    Comp.2    Comp.3     Comp.4
    Standard deviation     1.5748783 0.9948694 0.5971291 0.41644938
    Proportion of Variance 0.6200604 0.2474413 0.0891408 0.04335752
    Cumulative Proportion  0.6200604 0.8675017 0.9566425 1.00000000
    

    You can investigate the result object with str():

    str(pc.cr)
    List of 7
     $ sdev    : Named num [1:4] 1.575 0.995 0.597 0.416
      ..- attr(*, "names")= chr [1:4] "Comp.1" "Comp.2" "Comp.3" "Comp.4"
     $ loadings: loadings [1:4, 1:4] -0.536 -0.583 -0.278 -0.543 0.418 ...
      ..- attr(*, "dimnames")=List of 2
      .. ..$ : chr [1:4] "Murder" "Assault" "UrbanPop" "Rape"
      .. ..$ : chr [1:4] "Comp.1" "Comp.2" "Comp.3" "Comp.4"
     $ center  : Named num [1:4] 7.79 170.76 65.54 21.23
      ..- attr(*, "names")= chr [1:4] "Murder" "Assault" "UrbanPop" "Rape"
     $ scale   : Named num [1:4] 4.31 82.5 14.33 9.27
      ..- attr(*, "names")= chr [1:4] "Murder" "Assault" "UrbanPop" "Rape"
     $ n.obs   : int 50
     $ scores  : num [1:50, 1:4] -0.986 -1.95 -1.763 0.141 -2.524 ...
      ..- attr(*, "dimnames")=List of 2
      .. ..$ : chr [1:50] "Alabama" "Alaska" "Arizona" "Arkansas" ...
      .. ..$ : chr [1:4] "Comp.1" "Comp.2" "Comp.3" "Comp.4"
     $ call    : language princomp(x = USArrests, cor = TRUE)
     - attr(*, "class")= chr "princomp"
    

    Now extract the scores:

    head(pc.cr$scores)
                   Comp.1     Comp.2      Comp.3       Comp.4
    Alabama    -0.9855659  1.1333924 -0.44426879  0.156267145
    Alaska     -1.9501378  1.0732133  2.04000333 -0.438583440
    Arizona    -1.7631635 -0.7459568  0.05478082 -0.834652924
    Arkansas    0.1414203  1.1197968  0.11457369 -0.182810896
    California -2.5239801 -1.5429340  0.59855680 -0.341996478
    Colorado   -1.5145629 -0.9875551  1.09500699  0.001464887
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.