Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(readxl)
- datos=read_excel("D:/Descargas/DATABASES/practica componentes principales.xlsx")
- datos1=datos[c(1:30),c(11:19)]
- plot(datos1)
- m=princomp(datos1,cor=TRUE)
- m$scores
- cor(datos1)
- valvec=eigen(cor(datos1))
- a=(m$scores[,1])/sqrt(valvec$values[1])
- b=(m$scores[,2])/sqrt(valvec$values[2])
- c=(m$scores[,3])/sqrt(valvec$values[3])
- Arl=370
- alfag=1/Arl
- alfai=1-(1-alfag)^(1/3)
- alfamedio=alfai/2
- LCI=qnorm(alfamedio)
- LCS=-LCI
- datos2=datos[c(31:40),c(11:19)]
- msc=m$scores
- d=predict(m,newdata=datos2)
- l=rbind(msc,d)
- a=(l[,1])/sqrt(valvec$values[1])
- b=(l[,2])/sqrt(valvec$values[2])
- c=(l[,3])/sqrt(valvec$values[3])
- plot(a,b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement