I want to perform coresspondence analysis and calculate linear regression between variable and dimentionals
0
0
Entering edit mode
4.4 years ago

Hello

I want to perform coresspondence analysis and calculate linear regression between variable and dimentionals .

Should my data be scaled ?

I have two sets of data, one in percent and one in decimal,I standardized them

I get an error when I execute the following command. please guide me

#data(cc3 ,ac,vv) for cc3 line 10 active con
library("FactoMineR")
library("ggplot2")
library("factoextra")
library("corrplot")
a=file.choose()
a=read.table(a,header=T)
a=scale(a)
#write.csv(a,file = "a.csv")
#View(a)
#a=t(a)
#dt <- as.table(as.matrix(a[,1:3]))
 dt <- as.table(as.matrix(a))
# 2. Graph

p <- ggplot(as.data.frame(t(dt)) 

            ,aes(x =Var1, y = Var2))

p+geom_point(aes(size=Freq),shape=21, colour="black", fill="skyblue")+

  theme(panel.background=element_blank(), panel.border = element_rect(colour = "blue", fill=NA, size=1))

  scale_size_area(max_size=15)
#labs(x="Doing By", y="Tasks")
res.ca <- CA(dt, graph = TRUE)

####
> res.ca <- CA(dt, graph = TRUE)
Error in eigen(crossprod(t(X), t(X)), symmetric = TRUE) : 
  infinite or missing values in 'x'
In addition: Warning messages:
1: In sqrt(col.w) : NaNs produced
2: In sqrt(row.w) : NaNs produced
R • 1.2k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
code_formatting

ADD REPLY
0
Entering edit mode

CA is typically applied to contingency tables. At the minimum, the data has to be positive and on the same scale. Standardization may achieve the latter but most likely introduces negative values. If your decimal data represent fractions then convert them to percentage or convert the percentages to fraction. We can't say much more without seeing the data, e.g. it could also be that your data is not suitable for CA.

ADD REPLY

Login before adding your answer.

Traffic: 1343 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6