If I have a data set containing 4137 observations and I want to do a regression of colga on hsperc and sat using only the first 2070 observations, how do I do?
I have tried something like:
# loading data
GPA2 <- read.table("GPA2.raw", header=TRUE, na.strings=".")
# fitting model
mfit1 <- lm( formula = colgpa ~ hsperc + sat, data=GPA2, subset=(rownum<2071) )
But the subset
using rownum
fails. Any suggestions??
I don't have a variable that counts the number of rows, shoud I have that? In that case, how do i do that?