Displaying 1 result from an estimated 1 matches for "thefirstpredictor".
2009 Jul 26
1
obtain names of variables and data from glm object
...ance, suppose the "right way" was to use the (currently fictitious)
functions theresponse(), thepredictors(), and theDataSet(). Then I would be
able to write a function that obtains the names and subsequently pastes text
along the following lines:
theResponse <- theresponse( myglm )
theFirstPredictor <- thepredictors( myglm )[1]
theDataSet <- theDataSet(myglm)
title(main= paste(theResponse, " is the response and ", theFirstPredictor, "
is the only predictor")
In reality, I can of course extract
> formula(myglm)
y ~ x
but I see no elegant way to extract the name...