Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
775 views
in Technique[技术] by (71.8m points)

statistics - T-Test in R using "ggpubr"

I am trying to perform a two sided t-test with R.

This is my data as CSV (called "laegern" in the code):

coverage;type;P
grassland;litter;0.0965
grassland;topsoil;0.0762
grassland;subsoil;0.071
grassland;litter;0.0973
grassland;topsoil;0.0626
grassland;subsoil;0.0541
grassland;litter;0.0769
grassland;topsoil;0.0558
grassland;subsoil;0.0584
forest;litter;0.0749
forest;topsoil;0.0519
forest;subsoil;0.0315
forest;litter;0.0637
forest;topsoil;0.0445
forest;subsoil;0.0412
forest;litter;0.0769
forest;topsoil;0.0482
forest;subsoil;0.042

And this my code:

library(ggpubr)
....
t.test(laegern$P~laegern$type =="litter", var.equal = TRUE, alternative = "two.sided")

Everything from importing, plotting etc. is working, but the code for the statistical test does not take the right values. The aim is to make a t-test for the value "P" with "litter" comparing "grassland" and "forest". The same should as well be done for the "topsoil" and "subsoil". Can anyone help?

Thanks a lot a nice evening.

question from:https://stackoverflow.com/questions/65926840/t-test-in-r-using-ggpubr

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...