[R] simple plot in ggplot2, wrong error bars

2010-03-11 Thread hpdutra
I was wondering if anyone could help me with this, simple problem. I am essentially following the example on Hadley's webpage (http://had.co.nz/ggplot2/geom_errorbar.html), but it still doesn't make any sense to me. df <- data.frame(trt = factor(c("intact", "intact", "removed", "removed")),

Re: [R] model simplification using Crawley as a guide

2010-01-05 Thread hpdutra
So here is some information that I hope gets criticized by the higher-intelligences that posted on this topic. Beware that I'm not a statistician and I'm just saying about what I think is correct. First, before fitting any model, check the distribution of your data, in some cases a simple anova i

Re: [R] ANCOVA with defined error terms

2009-08-25 Thread hpdutra
Could someone or Richard explain to me what he meant by "This also shows a singular Error(). We look at the data and see that plot is identical to the three-way veget:fruit:block interaction." It seems to me that I just needed to recoded the plots, in order to get rid of the Error message. If t

Re: [R] ANCOVA with defined error terms

2009-08-23 Thread hpdutra
When we ran a regular ANOVA we showed that both mice and raccoons respond positively to cover. So we decided to use raccoons as a co-variate because those are mouse predators and their presence per se could explain part of the variation on mice activity. That is the reason why I'm running this AN

Re: [R] ANCOVA with defined error terms

2009-08-23 Thread hpdutra
What does the command c:\progra~1\R\R-2.9.1\bin\Rgui --vanilla do? At first I thought that I could run it from R. But then it did not work. I'm using a mac, and I don't know how access MSDOS in a mac. I actually installed R on the pc and tried to run the command from MSDOS and it also didn't wor

Re: [R] ANCOVA with defined error terms

2009-08-22 Thread hpdutra
I can actually run the code from my post. I used the nabble for my list server http://www.nabble.com/ANCOVA-with-defined-error-terms-td25055311.html#a25100032 I don't know which server you use, but that one is not truncated, I can copy the code just fine and run it. Anyway, here it is again summ

Re: [R] ANCOVA with defined error terms

2009-08-22 Thread hpdutra
Hi Richard, there are no empty cells. I transform everything into factor, except the co-variate coon. Here is the full analysis with dput of the data. I'm afraid I have not enough DF for the thre-way interaction using your model as well. 12 plots divided in 3 blocks, each plot assigned to 2 cros

Re: [R] ANCOVA with defined error terms

2009-08-22 Thread hpdutra
Thank you Richard, this works. But, the model you suggested me lacks some between subjects interactions, namely: veget:time:block fruit:time:block. According to Sokal and Rohlf I need to report those as well. Also, any ideas why the sum of squares on my model are different from yours summar

Re: [R] ANCOVA with defined error terms

2009-08-20 Thread hpdutra
Thanks Richard, I tried running the analysis the way you suggested but here is the error that I get > track.aov <- aov(mice ~ coon+block*veget*fruit*time - > block:veget:fruit:time + + Error(block/plot), data = track) Warning message: In aov(kotz.mice ~ kotz.coon + block * veget

[R] ANCOVA with defined error terms

2009-08-19 Thread hpdutra
I am trying to run an ANCOVA with defined error terms. Thus I have to use AOV and not lm. my response variable is proportion of mice paw prints on track plates. These plates were placed on plots that had vegetation and fruit manipulated to two levels each (present or absent), and were sampled mo

[R] appropriate error term for AOV repeated block design

2009-02-09 Thread hpdutra
I am using AOV and I am not sure if my model structure is correct for the repeated measures. I want to verify if there is a interaction of a random factor(block) with fixed factors(veget,fruit, time,) > model<-aov(trackarcsin~veget*fruit*time*block > +Error(block/(veget*fruit)),data=mice) Becau

Re: [R] RE SHAPE package question.

2008-08-02 Thread hpdutra
That works. I still think you should have named RESHAPE as "MAGIC"! It is amazing how much of time saver this tool is! Thanks a lot. -- View this message in context: http://www.nabble.com/RESHAPE-package-question.-tp18792801p18794249.html Sent from the R help mailing list archive at Nabble.com

Re: [R] RE SHAPE package question.

2008-08-02 Thread hpdutra
imple but I just don't know how to do it. I was hoping that it would give me the following data t1 t2 t3 t4 M F id 1 1 0 0 0 2 1 1 2 1 0 1 1 3 1 1 Many thanks! hpdutra wrote: > > Hi there, > > I am trying to reorganized my data sets so that it is easy for M

[R] RE SHAPE package question.

2008-08-02 Thread hpdutra
Hi there, I am trying to reorganized my data sets so that it is easy for MARK to read it. Basically I have the encounter histories of 1837 butterflies The data looks like this the first 4 columns are the occasions and the last two code for male and female > t1 t2 t3 t4 M F > 10 0

Re: [R] wroung groupedData despite reading Bates and Pinheiro 3 times

2008-07-19 Thread hpdutra
er that, so I need to get the groupedData correct. Thank you very much Humberto Dutra try trap$time<-factor(trap$time) trap$block<-factor(trap$block) On 7/19/08, hpdutra <[EMAIL PROTECTED]> wrote: > > > Hi everyone. I am trying to add a formula to my data using the >

[R] wroung groupedData despite reading Bates and Pinheiro 3 times

2008-07-19 Thread hpdutra
Hi everyone. I am trying to add a formula to my data using the groupedData function. My experiment consists of randomized block design using fruits, vegetation and time as factors. The idea is to see if fruits, vegetation and time explain the abundance of mice. I am using tree density as a covar

Re: [R] specifying data

2008-07-12 Thread hpdutra
have you tried reshape package? library(reshape) dfm <- melt(dataframe, m = "date") You can find out more about reshape at http://had.co.nz/reshape sprohl wrote: > > Hello, > I have to merge several serie by "date". I used: > > cb<-merge(cbds,cbbond,by=c("date"),all=T). > > I have the dail

Re: [R] ggplot2 book?

2008-07-12 Thread hpdutra
apparently he does https://stat.ethz.ch/pipermail/r-packages/2007/000298.html Felipe Carrillo wrote: > > Hi (Hadley): Do you still have the ggplot2 book being published this > summer? > > Felipe D. Carrillo Fishery Biologist Department of the Interior US > Fish & Wildlife Service Califor

[R] GroupedData for three way randomized block. LME

2008-07-11 Thread hpdutra
I am trying to fit a formula to my data, but I just can't find the right way to do it. My experiment consists of manipulating FRUITS and VEGETATION to two levels each(intact or removed) on 12 experimental plots. This leaves me with 4 treatment combinations Fruit intact Vegetation removed Fruit in

[R] What is my replication unit? Lmer for binary longitudinal data with blocks and two treaments.

2008-07-06 Thread hpdutra
First I would like to say thank you for taking the time to read it.Here is my problem. I am running a lmer analysis for binary longitudinal (repeated measures) data. Basically, I manipulated fruits and vegetation to two levels each(present and absent) and I am trying to access how these factors

Re: [R] Error: cannot use PQL when using lmer

2008-07-05 Thread hpdutra
In fact I am using Crawley example to fit my data. I am running a lmer analysis for binary longitudinal (repeated measures) data. Basically, I have 12 plots, divided in 3 blocks, each block contain 4 plots. Plots were manipulate for fruits (F) and vegetation (V) that were either intact(I) or re

Re: [R] interpreting mixed model anova results

2008-07-05 Thread hpdutra
Sounds like a repeated measures design, if so then you have to incorporate this into your model before interpreting the results. Brooke LaFlamme-2 wrote: > > Hi, I am trying to do a repeated measures ANOVA to determine if there is a > significant difference between two sets of timecourse data.

[R] Error: cannot use PQL when using lmer

2008-07-05 Thread hpdutra
I am trying to do an exercise on Crawley's book and I get this error message. I ran the same analysis in the past but now that I upgraded my R in my Macbook I get this message. Is this a bug or what is going on. It doesn't make any sense > library(MASS) > attach(bacteria) > table(y) y n y 43

[R] Error: cannot use PQL when using lmer

2008-07-05 Thread hpdutra
> library(MASS) > attach(bacteria) > table(y) y n y 43 177 > y<-1*(y=="y") > table(y,trt) trt y placebo drug drug+ 0 12 1813 1 84 4449 > library(lme4) > model1<-lmer(y~trt+(week|ID),family=binomial,method="PQL") Error in match.arg(method, c("Laplace", "AGQ"))