[R-sig-eco] report out by t.test

2014-03-23 Thread Michael Marsh
I test differences between frequency of hits of exotic annual forbs in 
plots on  two sites, Q and WD.


> Q<-c(13,0,10,2,0,0,1,0,0,1,5)
> WD<-c(0,0,1,0,0,0,0,0,0,0,1)
> t.test(Q,WD)

Welch Two Sample t-test

data:  Q and WD
t = 1.9807, df = 10.158, p-value = 0.07533
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.3342006  5.7887460
sample estimates:
mean of x mean of y
2.9090909 0.1818182

The p-value is greater than 0.05, thus does not reach the 95% confidence 
level, yet the difference in means is reported as not equal to 0.
Am I encountering a one-sided versus two sided comparison that I don't 
understand, or is ther another explanation?


Mike Marsh

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] Plot question

2014-03-23 Thread Luis Fernando García
Dear R friends,

I have to produce a plot like the one attached on the file. The idea is to
plot the time spent for a spider over several different prey, the spiders
were repreated in the different trials. If any of you knows how to perform
this plot or have any source which explains how to do it, I would really
appreciate it.

Thanks in advance.


Plot : http://imgur.com/u1FNmwn
spider  preytime
1   cockroach   136
1   ant 128
1   termite 115
1   fly 145
1   isopod  115
2   cockroach   187
2   ant 142
2   termite 114
2   fly 115
2   isopod  123
3   cockroach   111
3   ant 121
3   termite 113
3   fly 115
3   isopod  117
4   cockroach   142
4   ant 132
4   termite 156
4   fly 142
4   isopod  113
5   cockroach   115
5   ant 121
5   termite 217
5   fly 213
5   isopod  112
___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Plot question

2014-03-23 Thread Nicholas Hamilton
Garcia,

Just use ggplot2, here is some code to illustrate:

--

library(ggplot2)

#Create some dummy data with x, y and category columns
mysample <- function(category) 
data.frame(x=c(1:10),y=c(10:1)*(1+0.25*runif(10)),Category=category)
dfA = mysample("A")
dfB = mysample("B")
dfC = mysample("C")
df = rbind(dfA,dfB,dfC)

#and plot
ggplot(data=df,aes(x,y,color=Category)) + geom_point() + geom_path() + 
labs(x="xaxis",y="yaxix",title="The title")

-
Regards,

Nicholas Hamilton
UNSW School of Materials Science and Engineering
www.ggtern.com



From: r-sig-ecology-boun...@r-project.org [r-sig-ecology-boun...@r-project.org] 
on behalf of Luis Fernando García [luysgar...@gmail.com]
Sent: Monday, March 24, 2014 11:32 AM
To: r-sig-ecology@r-project.org
Subject: [R-sig-eco] Plot question

Dear R friends,

I have to produce a plot like the one attached on the file. The idea is to
plot the time spent for a spider over several different prey, the spiders
were repreated in the different trials. If any of you knows how to perform
this plot or have any source which explains how to do it, I would really
appreciate it.

Thanks in advance.


Plot : http://imgur.com/u1FNmwn

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] Plot question

2014-03-23 Thread Tim Meehan
Hi Luis,

You can try this:

# enter data
spider <- c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)
prey <-
c("cockroach","ant","termite","fly","isopod","cockroach","ant","termite","fly","isopod","cockroach","ant","termite","fly","isopod","cockroach","ant","termite","fly","isopod","cockroach","ant","termite","fly","isopod")
time <-
c(136,128,115,145,115,187,142,114,115,123,111,121,113,115,117,142,132,156,142,113,115,121,217,213,112)

# turn into a dataframe
dat <- data.frame(spider=spider, prey=prey, time=time)

# set and reorder factors
dat$spider <- factor(dat$spider)
dat$prey = factor(dat$prey,levels(dat$prey)[c(3,5,2,1,4)])

# check data
str(dat)
head(dat)

# import plotting library and make plot
library(ggplot2)
p = ggplot(data=dat, aes(prey, time, group = spider, colour= spider))
p + geom_line() + geom_point(shape=1, size=4) + theme_bw()

Best,
Tim


On Sun, Mar 23, 2014 at 8:08 PM, Nicholas Hamilton <
n.hamil...@student.unsw.edu.au> wrote:

> Garcia,
>
> Just use ggplot2, here is some code to illustrate:
>
> --
>
> library(ggplot2)
>
> #Create some dummy data with x, y and category columns
> mysample <- function(category)
> data.frame(x=c(1:10),y=c(10:1)*(1+0.25*runif(10)),Category=category)
> dfA = mysample("A")
> dfB = mysample("B")
> dfC = mysample("C")
> df = rbind(dfA,dfB,dfC)
>
> #and plot
> ggplot(data=df,aes(x,y,color=Category)) + geom_point() + geom_path() +
> labs(x="xaxis",y="yaxix",title="The title")
>
> -
> Regards,
>
> Nicholas Hamilton
> UNSW School of Materials Science and Engineering
> www.ggtern.com
>
>
> 
> From: r-sig-ecology-boun...@r-project.org [
> r-sig-ecology-boun...@r-project.org] on behalf of Luis Fernando García [
> luysgar...@gmail.com]
> Sent: Monday, March 24, 2014 11:32 AM
> To: r-sig-ecology@r-project.org
> Subject: [R-sig-eco] Plot question
>
> Dear R friends,
>
> I have to produce a plot like the one attached on the file. The idea is to
> plot the time spent for a spider over several different prey, the spiders
> were repreated in the different trials. If any of you knows how to perform
> this plot or have any source which explains how to do it, I would really
> appreciate it.
>
> Thanks in advance.
>
>
> Plot : http://imgur.com/u1FNmwn
>
> ___
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] report out by t.test

2014-03-23 Thread Baldwin, Jim -FS
The sentence "alternative hypothesis: true difference in means is not equal to 
0" is stating what the alternative hypothesis is and not that your particular 
difference in means is significantly different from zero.  That sentence would 
appear (when you have a two-tailed test) no matter what the P-value might be.

Try

t.test(Q,WD)
t.test(Q,WD,alternative="two.sided")   # Default
t.test(Q,WD,alternative="less")
t.test(Q,WD,alternative="greater")


Jim

Jim Baldwin
USDA Forest Service

-Original Message-
From: r-sig-ecology-boun...@r-project.org 
[mailto:r-sig-ecology-boun...@r-project.org] On Behalf Of Michael Marsh
Sent: Sunday, March 23, 2014 2:22 PM
To: r-sig-ecology@r-project.org
Subject: [R-sig-eco] report out by t.test

I test differences between frequency of hits of exotic annual forbs in plots on 
 two sites, Q and WD.

 > Q<-c(13,0,10,2,0,0,1,0,0,1,5)
 > WD<-c(0,0,1,0,0,0,0,0,0,0,1)
 > t.test(Q,WD)

 Welch Two Sample t-test

data:  Q and WD
t = 1.9807, df = 10.158, p-value = 0.07533 alternative hypothesis: true 
difference in means is not equal to 0
95 percent confidence interval:
  -0.3342006  5.7887460
sample estimates:
mean of x mean of y
2.9090909 0.1818182

The p-value is greater than 0.05, thus does not reach the 95% confidence level, 
yet the difference in means is reported as not equal to 0.
Am I encountering a one-sided versus two sided comparison that I don't 
understand, or is ther another explanation?

Mike Marsh

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology





This electronic message contains information generated by the USDA solely for 
the intended recipients. Any unauthorized interception of this message or the 
use or disclosure of the information it contains may violate the law and 
subject the violator to civil or criminal penalties. If you believe you have 
received this message in error, please notify the sender and delete the email 
immediately.

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology