I've been trying for a while to regress between the first observation and the rest of the 199 observations of my data set. I used the lapply function and the regression result is stored as a list in the environment. My aim is to get only the list of p_values as a data frame and determine how many observations are less than 0.05. Any help would be appreciated!
## Here are the code I am using right now.
myre1 <- apply(2:ncol(muscle), function(x) lm(muscle[,1] ~ muscle[,x], data = muscle))
myre2 <- lapply(muscle[,-1], function(x) lm(muscle$GIR ~ x))
## To extract the coefficient
myre3 <- lapply(2:ncol(muscle), function(x) coefficients(lm(muscle[,1] ~ muscle[,x], data = muscle)))
myre4 <- lapply(muscle[,-1], function(x) coefficients(lm(muscle$GIR ~ x)))