Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 prcomp 实现 PCA。
pcaunemp <- prcomp(rawtChange,center = TRUE, scale=FALSE)
我正在使用 lm 函数进行回归,如下所示:
reg <- lm(tr[5:365,1] ~ tr[1:361,1] + tr[2:362,1] + tr[3:363,1] + tr[4:364,1])
如果我只想将前 8 个分量用作回归的自变量,如何提取这些分量?
我可以提取前 8 台 PC:
pcaunemp$x[, 1:8]
感谢在评论中回答的李哲源