# [R-sig-eco] Predict with 2 factors in an additive model

Chris Howden chris at trickysolutions.com.au
Mon Oct 17 01:47:08 CEST 2011

```Expand.grid() is also an easy way to get all the different combination for
input factors.

Chris Howden B.Sc. (Hons) GStat.
Founding Partner
Evidence Based Strategic Development, IP Commercialisation and Innovation,
Data Analysis, Modelling and Training
(mobile) 0410 689 945
(fax) +612 4782 9023
chris at trickysolutions.com.au

Disclaimer: The information in this email and any attachments to it are
confidential and may contain legally privileged information. If you are
not the named or intended recipient, please delete this communication and
disclose this communication or any attachments without our consent.
Although this email has been checked by anti-virus software, there is a
risk that email messages may be corrupted or infected by viruses or other
interferences. No responsibility is accepted for such interference. Unless
expressly stated, the views of the writer are not those of the company.
Tricky Solutions always does our best to provide accurate forecasts and
analyses based on the data supplied, however it is possible that some
important predictors were not included in the data sent to us. Information
provided by us should not be solely relied upon when making decisions and
clients should use their own judgement.

-----Original Message-----
From: r-sig-ecology-bounces at r-project.org
[mailto:r-sig-ecology-bounces at r-project.org] On Behalf Of cparker at pdx.edu
Sent: Saturday, 15 October 2011 11:51 AM
To: Manuel Spínola
Cc: r-sig-ecology at r-project.org
Subject: Re: [R-sig-eco] Predict with 2 factors in an additive model

Try this

newData = data.frame(f1 = factor(c("a","a","b","b")), f2 = factor(c("b",
"a","b","a")))

And use that newData in your predict statement

On Oct 14, 2011, at 4:09 PM, Manuel SpC-nola <mspinola10 at gmail.com> wrote:

> newData = data.frame(f1 = factor(c("a", "b")), f2 = factor(c("b", "a")))

[[alternative HTML version deleted]]

```