Hi I am very new to R and to this forum.
I want to run multiple regressions on subsamples from a large dataset.
Here is a sample of my dataset named "totaldoc":
I want to do lm(numericdiffNGO∼numericdiffmeeting))
for each issue_name1.
I tried this command :
lapply(split(totaldoc, f = list(totaldoc$issue_name1)), function(x) lm(numericdiffNGO∼numericdiffmeeting))
and this command
ddply(totaldoc, "issue_name1", function(df)coefficients (lm(numericdiffNGO∼numericdiffmeeting, data=df)))
But it only give me the coefficients and even not for all the issu-name1 What I want to do is to have each p value per subsamples issu-name1 and to rank them from the most significant to the highest. And the same for rsquared but for the reverse so, the highest to the lowest.