Error in inherits(x, "data.frame") : Object "d" not
found
Where q is a vector with the dependent variable's
values
and m is a matrix containing the values of the
independent variables.
While writing the above without a function form has no
problem, that is :