Skip to content
Prev 247670 / 398503 Next

lm() portion of data

On 11-01-18 12:49 PM, Karen Aanensen wrote:
You need to use the subset argument to lm, e.g.

lm(cases ~ Date.Code, subset = (x1 <= Date.Code) & (Date.Code <= x2))


I'd recommend using the data= ... argument to lm() rather than relying 
on finding the variables in the global environment as well.

Duncan Murdoch