[R] Seeking pointers to various regression techniques with R?
Peter Ehlers
ehlers at ucalgary.ca
Wed Jun 6 01:18:03 CEST 2012
You mention 3 models. In all of them, the '-1' simply removes
the intercept term; help('formula') explains the use of '-'
in general.
1. lm(y~ x * w - 1) is clearly explained in help('formula');
2. lm(y~ x:w - 1) ditto (and this is a model to avoid);
3. lm(y~ x/w - 1) this is equivalent to lm(y~ x + w %in% x - 1)
where the %in% operator is explained in help('formula'). A good
and simple example is found in the MASS book (chapter 6) the code
for which is available in the 'Scripts' subfolder of library/MASS
of your R installation.
Peter Ehlers
On 2012-06-05 13:58, Michael wrote:
> I read your website but still don't know the difference between the three
> formulas...
>
> Thank you!
>
> On Mon, Jun 4, 2012 at 11:14 PM, Joshua Wiley<jwiley.psych at gmail.com>wrote:
>
>> Hi Michael,
>>
>> This is far from exhaustive (I wrote it as an introduction some years
>> ago) but you may find it useful to start:
>> https://joshuawiley.com/R/formulae_in_R.aspx
>>
>> Cheers,
>>
>> Josh
>>
>> On Mon, Jun 4, 2012 at 9:06 PM, Michael<comtech.usa at gmail.com> wrote:
>>> Hi all,
>>>
>>> Could you please point me to good materials on various
>>> tricks/intuitions/techniques of regression, and hopefully in R?
>>>
>>> For example, what does lm(y~ x * w - 1) mean vs. lm(y ~ x/w -1 ) vs. lm
>> (y
>>> ~ x:w-1), etc...
>>>
>>> I just found that even simple linear regression is not that simple and
>>> there are a lot of tricks/techniques in using them...
>>>
>>> Hopefully I can find good materials on these!
>>>
>>> Thank you!
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html>
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>
>> --
>> Joshua Wiley
>> Ph.D. Student, Health Psychology
>> Programmer Analyst II, Statistical Consulting Group
>> University of California, Los Angeles
>> https://joshuawiley.com/
>>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list