Home > In R > 'princomp' Can Only Be Used With More Units Than Variables

'princomp' Can Only Be Used With More Units Than Variables

Contents

All the > variable which I am having are numeric in nature..What should I do > next? I.e., I'd like to have a correlation betweenany 2 variables to be based on all cases that have valid values on bothvariables.What should my na.action be in this case?Thank you very I am running it like this: mypc <- princomp(~.,data=q7a.forfa, cor=TRUE, na.action=na.omit) With na.omit it works. Membership benefits: Get your questions answered by community gurus and expert researchers. Exchange your learning and research experience among peers and get advice and insight.

Reply With Quote + Reply to Thread Tweet « access S-plus objects from multiple machines | Probability Calculations » Posting Permissions You may not post new threads You may Jamie Options:Reply•Quote Re: factor analysis Posted by: Jan de Leeuw () Date: December 09, 2009 01:19PM If your input is a formula the standard ways of handling missing data are applied. But I have way too many unsystematically missing values on different variables. All rights reserved.

'princomp' Can Only Be Used With More Units Than Variables

Also look at package pcaMethods (on Bioconductor), where you will find a full range of options for carrying out principal component analysis using matrices with missing values. Free forum by Nabble Edit this page R › R help Search everywhere only in this topic Advanced Search Principal Components for matrices with NA ‹ Previous Topic Next Topic › I was just wondering if the function can do it "itself". Not before.

r dataframe pca na princomp share|improve this question edited May 1 '14 at 2:44 John Paul 4,60121739 asked Apr 30 '12 at 15:41 jon 4,237846106 2 My answer below addresses WC1E 6BT. [w] http://www.freshwaters.org.uk%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code. « Show us data. –Roland Jul 24 '14 at 18:47 add a comment| up vote 3 down vote The first column was date.. Efa In R How to explain the use of high-tech bows instead of guns more hot questions question feed lang-r about us tour help blog chat data legal privacy policy work here advertising info

current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. Thanks. 1) Please don't send personal requests; keep replies on list, when requesting further help. 2) You haven't read or complied with the posting guide, providing none of the requested information. Ravi. ---------------------------------------------------------------------------- ------- Ravi Varadhan, Ph.D. Fill in the Minesweeper clues Is there an adverb meaning "by volunteering"?

When I run princomp I receive the following error: Error in cov.wt(z) : 'x' must contain finite values only Where am I going wrong? Na.omit Function In R I have used R successfully for a couple of projects now, but I have relied heavily on others' tutorials and how-to pages. Get 2 lines yanked or 1 line yanked confirmation How do I translate "hate speech"? Kind Regards JS [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.

  1. That might have changed NA to "NA".
  2. But how to deal with BCE dates?0Using nleqslv: function contains non-finite values Hot Network Questions Interviewee offered code samples from current employer -- should I accept?
  3. I also have a more general question: do you have suggestions for learning to follow R's documentation pages?
  4. Adaikalavan Ramasamy Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: princomp error You probably got some missing or undefined values.
  5. For your big question, about how to proceed when your data contain many NA's, a quick google search on "missing values pca" turns up a ton of useful hits, including [this
  6. I.e., I'd like to have a correlationbetweenany 2 variables to be based on all cases that have valid values onbothvariables.What should my na.action be in this case?Thank you very much!--Dimitri Liakhovitski[[alternative
  7. Can I only touch other creatures with spells such as Invisibility?
  8. reply | permalink Dimitri Liakhovitski Yes, that's what I've done.
  9. R doesn't care what /you/ think your data are, only what /it/ thinks they are.
  10. UPDATE: based on the answers: > mydf <- data.frame (A = c(NA, rnorm(10, 4, 5)), B = c(NA, rnorm(9, 4, 5), NA), + C = c(NA, NA, rnorm(8, 4, 5), NA))

Cannot Use 'cor = True' With A Constant Variable

I don't know if it's because I have no programming experience or if they are written in some variant of English I have never learned, but I find them quite opaque. Gavin Simpson [t] +44 (0)20 7679 0522 > ECRC, UCL Geography, [f] +44 (0)20 7679 0565 > 'princomp' Can Only Be Used With More Units Than Variables Thank you! Missing Values Pca I could find the maximal set of columns such that there exists a subset of rows with non NA values for every column in the set - what is an efficient

You can convert the *components* of the data.frame to numerics, for example foo$bar <- as.numeric(foo$bar) or foo <- within(foo, bar <- as.numeric(bar)) But that isn't sufficient for factors, you need to I.e., I'd like to have a correlation betweenany 2 variables to be based on all cases that have valid values on bothvariables.What should my na.action be in this case?Thank you very Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com William Dunlap at Mar 20, 2013 at 11:35 pm ⇧ You can build the variance matrix you want "manually" with cov(x, use="pairwise").You can supply Rui Barradas Threaded Open this post in threaded view ♦ ♦ | Report Content as Inappropriate ♦ ♦ Re: Principal Components for matrices with NA Hello, > I could find Princomp In R

You have several options. How do I know what each of the scores is scoring? [R] Psych package: fa.diagram, how to re-arrange layout so numbers do not over-write each other [R] Error messages when attempting I triedna.action = na.pass, but it's not working:Error in cov.wt(z) : 'x' must contain finite values onlyCan it be that princomp does not allow pairwise deletion of misisng values?Thank you!DimitriOn Wed, share|improve this answer edited Apr 30 '12 at 20:45 answered Apr 30 '12 at 15:46 Tyler Rinker 45.7k18143286 thanks, that is definately helpful, I think I replaced blank spaces

Is there any R method that can impute the data doing PCA analysis? Wtmx Previous message: [R] PCA - "cov.wt(z) : 'x' must contain finite values only" Next message: [R] Scatterplot Showing All Points Messages sorted by: [ date ] [ thread ] [ subject Not the answer you're looking for?

And removing the columns of dates led or proper operation of the PCA function? –DirtStats Jul 3 at 18:55 add a comment| up vote 1 down vote Make sure you only

Not before.This sad truth being said - can I do it directly in the function, withoutbuilding a intercorrelation matrix manually?Thank you!DimitriOn Wed, Mar 20, 2013 at 7:04 PM, Bert Gunter wrote:Well, I imported the data using read.table and there are both column and row headers. If you still need help after doing some research, I'd head over to stats.stackexchange.com , since this is really a statistical question. –Josh O'Brien Apr 30 '12 at 16:37 Principal Component Analysis If the site names are just part of the identifier for each observation you can include it in the rownames and remove site names from the input dataframe to princomp.

WC1E 6BT. [w] > http://www.freshwaters.org.uk> %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~ > %~%~%~% > Basically, you need to know what's on them, and consult them for details only. asked 2 years ago viewed 9821 times active 3 months ago Blog Stack Overflow Podcast #92 - The Guerilla Guide to Interviewing Related 5Have lubridate subtraction return only a numeric value1How The time now is 07:04 AM.

Fill in the Minesweeper clues How to remove screws from old decking Where's the 0xBEEF? Maximize result of bitwise AND What does "Game of the Year" actually mean? How could I tell R to substitute another value from the same row for any NAs? of Crop and Soil Sciences > Washington State University > 291D Johnson Hall > PO Box 646420 > Pullman, WA 99164-6420 > Work: 509.335.3661 > Cell/Home: 406.570.8576 > Fax: 509.335.8674 >

The error is telling you that as far as R is concerned, some of your data are not considered numeric. Are illegal immigrants more likely to commit crimes? The result of such NA omission will give me ~ 0 rows or columns. I.e., I'd like to have a correlation betweenany 2 variables to be based on all cases that have valid values on bothvariables.What should my na.action be in this case?Thank you very

The following is the example code: mydf <- data.frame ( A = c("NA", rnorm(10, 4, 5)), B = c("NA", rnorm(9, 4, 5), "NA"), C = c("NA", "NA", rnorm(8, 4, 5), "NA") more hot questions question feed lang-r about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation methods('princomp') [1] princomp.default* princomp.formula* names(formals(stats:::princomp.formula)) [1] "formula" "data" "subset" "na.action" "..." names(formals(stats:::princomp.default)) [1] "x" "cor" "scores" "covmat" "subset" "..." share|improve this answer edited Apr 30 '12 at 19:38 answered Apr 30 But if I do, then I can go back to those for whom I am doing the analysis and tell them that.