I have code as per below. This runs numerous multiple regressions (all slightly different). It also reports the R2 value of these regressions in a nice table that I can easily copy and paste. This is achieve at the end of the code. However, I cannot seem to get a p-value table in a similar manner, from what I can tell there is no p-value function equivalent to the $r.squared function. Any help on that would be greatly appreciated.
Dependent variable =Cold Independent variables = Breed (categoric, col 2), Gender (categoric col 4), Dayno. (cols 6-1055, this is the difference between each regression).
r.sqr <- matrix(NA, nrow =1, ncol = length(6:ncol(rweights)))
for(i in 6:ncol(rweights)){
na.n <- length(which(is.na(as.numeric(unlist(rweights[,i])))))
if (na.n == nrow(rweights)) next
nn <- which(!is.na(as.numeric(unlist(rweights[,i]))))
if (is.na(unlist(rweights[nn,2])) && is.na(unlist(rweights[nn,4]))) next
fit <- lm(Cold~ Breed + Gender + as.numeric(unlist(rweights[,i])), data=rweights, , na.action=na.omit)
r.sqr[1,(i-5)] <- summary(fit)$r.squared
}