Rowan Brookes | 5 Aug 11:47
Picon
Picon
Favicon

unplanned contrasts with categorical and continuous variables

Hi,

I have conducted a general linear model with a mixture of continuous 
(POSITION; flower position on a raceme) and categorical (POLLEN and 
RESOURCE) variables.

The model looks like this: 
seedset.glm<-glm(MNSEED~POSITION*POLLEN*RESOURCE, family = gaussian, 
data = PR)

I have a significant interaction between position, pollen and resource 
but am unsure of how I should be doing an unplanned comparison when I 
have both categorical and continuous variables.  Can anybody direct me 
in the right direction?

I had initially turned flower position into a categorical variable, but 
had some opposition to this from reviewers.

Thanks very, very much,

Rowan
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@...
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
Griffith.Michael | 6 Aug 19:51
Picon

handling ca


In trying to use randomForest, I got the following error message:

Error in data.matrix(x) : non-numeric data type in frame

Am I correct that this means that randomForest  has not be written in R
to handle categorical predictor variables?  Is there a way around this?
I am working with two categorical variables (out of 4 predictor
variables) with more than 2 levels that do not have any particular order
to them.  The instructions for the original random forest program by
Brieman indicates that it handles categorical predictor variables, so I
am surprised that the R version does not.

Michael

Michael B. Griffith, Ph.D.
Research Ecologist

USEPA, NCEA (MS A-110)
26 W. Martin Luther King Dr.
Cincinnati, OH  45268

telephone:  513 569-7034
e-mail:  griffith.michael@...
Gavin Simpson | 7 Aug 11:23
Picon
Picon
Favicon

Re: handling ca

On Wed, 2008-08-06 at 13:51 -0400, Griffith.Michael@...
wrote:
> In trying to use randomForest, I got the following error message:
> 
> Error in data.matrix(x) : non-numeric data type in frame
> 
> Am I correct that this means that randomForest  has not be written in R
> to handle categorical predictor variables?  Is there a way around this?
> I am working with two categorical variables (out of 4 predictor
> variables) with more than 2 levels that do not have any particular order
> to them.  The instructions for the original random forest program by
> Brieman indicates that it handles categorical predictor variables, so I
> am surprised that the R version does not.

No, randomForest handles factors, as this simple example shows:

> dat <- data.frame(matrix(rnorm(1000), ncol = 10))
> dat$fac <- gl(4,25)
> head(dat)
           X1         X2         X3         X4          X5         X6
1 -0.15048037  1.2497460 -0.7728316 -0.3286552  1.59056488 -1.2579715
2 -0.67688208 -2.0189794 -0.3154595  0.5998583 -1.89438803 -0.9737503
3  1.02637837  0.3724476 -0.3145720  1.4510331  1.78757305  0.4365752
4  0.08031081  0.6534088 -0.6211070  0.1432012 -0.51041876 -1.0198103
5  0.09208803  0.6273971  0.7333440  0.4362220 -0.03848859  0.6260701
6 -1.41415813 -1.1515418 -0.7457416  1.5853533 -1.17111942  2.5486069
          X7         X8         X9        X10 fac
1  0.7698208 -1.8697214 -1.1568065  0.8459625   1
2 -0.2782257  0.1361337 -1.1308822  0.6001056   1
3 -1.0053869  0.5940746 -0.1833341  2.0251286   1
(Continue reading)

stephen sefick | 8 Aug 19:07
Picon

StreamMetabolism

StreamMetabolism has just been released on CRAN.  It is a package for
the calculation of stream metabolism based on the single station
method from diurnal oxygen curves.  It will probably undergo
significant upgrades as the need arises.  I would greatly appreciate
Comments, Suggestions, and help in improving upon this package.
Enjoy

Stephen Sefick

--

-- 
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

	-K. Mullis
Lingbo Li | 15 Aug 06:30
Picon
Picon
Favicon

quadratic factor

Hello R expert,

I have fish length and corresponding otolith size at six times for 30 fish. Firstly, I use a linear mixed
effect model to correlate the fish length (L) with otolith size in dorsal radius (Dor). Since the
residuals are domeshaped, I then tried to add a quadratic factor. However, as the summary shown below, the
quadratic factor was missing in the analysis. WHY?

Thank you very much.

Lingbo

> back<-read.table("back.r", header=T)

> attach(back)

> names(back)

[1] "Fish"  "Treat" "Mark"  "L"     "Dor"   "Dis"   "Ven"   "Width"

> library(nlme)

> ldor.lme=lme(L~Dor, random=~1|Fish)

> ldor11.lme=lme(L~Dor+Dor^2, random=~1|Fish)

> summary(ldor11.lme)

Linear mixed-effects model fit by REML

 Data: NULL 
(Continue reading)

Simon Blomberg | 15 Aug 07:12
Picon
Picon
Favicon

Re: quadratic factor

To include a quadratic term, use I(Dor^2) instead of Dor^2. The problem
is that R interprets Dor^2 as a formula term ie the main effect as well
as the second-order interaction of Dor with itself (which is just Dor).
Using the I() construct tells R to treat the enclosed expression as a
mathematical expression.

Cheers,

Simon.

On Thu, 2008-08-14 at 21:30 -0700, Lingbo Li wrote:
> Hello R expert,
> 
> I have fish length and corresponding otolith size at six times for 30 fish. Firstly, I use a linear mixed
effect model to correlate the fish length (L) with otolith size in dorsal radius (Dor). Since the
residuals are domeshaped, I then tried to add a quadratic factor. However, as the summary shown below, the
quadratic factor was missing in the analysis. WHY?
> 
> Thank you very much.
> 
> Lingbo
> 
> 
> > back<-read.table("back.r", header=T)
> 
> > attach(back)
> 
> > names(back)
> 
> [1] "Fish"  "Treat" "Mark"  "L"     "Dor"   "Dis"   "Ven"   "Width"
(Continue reading)

Louis Macovsky | 16 Aug 19:36
Picon

Time series modeling and simulation

Hello,

I am new to R and this list.

The rule is never apologize before asking your question.  So let me break this rule.  First I am not a
statistician and I have always struggled with the subject so please forgive me if I mangle terms and at
times seem naive.

The objective of my models and simulations is to reproduce observed time series data with tools that allow
multiple parameter assumptions and then try to predict future behavior of the modeled system.  Presently
my only computer tool for curve fitting is least squares.

As I add each parameter to my models, I attempt to throughly explore their effect on model behavior.

I would like to explore what I can do with R.  For now curve fitting and describe confidence limits of
simulated time series data.

I can export simulation results into excel for use by R.

Assuming my very brief description of my objectives is clear enough, please give me suggestions of
references and other reading sources that might help me explore what I can do with time series data in R.  Is
there anyone on this list doing the same?

Thanks,
Lou
	[[alternative HTML version deleted]]
Phil Turk | 17 Aug 15:55
Picon
Favicon

Re: R-sig-ecology Digest, Vol 5, Issue 5

Louis:

R has many options for time series analysis.  Google "R time series".

A couple of good books to get you started are 1.) Time Series Analysis: 
With Applications in R by Cryer and Chan and 2.) Time Series Analysis 
and Its Applications: With R Examples by Shumway and Stoffer.

-- Phil 

r-sig-ecology-request@... wrote:
> Send R-sig-ecology mailing list submissions to
> 	r-sig-ecology@...
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> or, via email, send a message with subject or body 'help' to
> 	r-sig-ecology-request@...
>
> You can reach the person managing the list at
> 	r-sig-ecology-owner@...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-ecology digest..."
>
>
> Today's Topics:
>
>    1. Time series modeling and simulation (Louis Macovsky)
>
(Continue reading)

Louis Macovsky | 18 Aug 05:40
Picon

Re: time series modeling and simulation

To all who have replied to my query,
Thanks.

Lou
Manuel Spínola | 19 Aug 18:30
Picon
Favicon

t-test with inverse variance weighting in R

Dear list members,

I have 4 estimates (each estimate have its se or variance), 2 from 
treatment units and 2 from control units.  I want to do a t-test with 
inverse variance weighting to compare treatment vs control units.
Does anybody knows if there is an R function to do this type of analysis?
I am trying to get the confidence interval of the difference (I am not 
interested in the t and P values).
Thank you very much in advance.
Best,

Manuel Spínola

--

-- 
Manuel Spínola, Ph.D.
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola@...
mspinola10@...
Teléfono: 277-3598
Fax: 237-7036

Gmane