R Dataset / Package DAAG / moths


On this R-data statistics page, you will find information about the moths data set which pertains to Moths Data. The moths data set is found in the DAAG R package. You can load the moths data set in R by issuing the following command at the console data("moths"). This will load the data into a variable called moths. If R says the moths data set is not found, you can try installing the package by issuing this command install.packages("DAAG") and then attempt to reload the data. If you need to download R, you can go to the R project website. You can download a CSV (comma separated values) version of the moths R data set. The size of this file is about 746 bytes.

Moths Data


The moths data frame has 41 rows and 4 columns. These data are from a study of the effect of habitat on the densities of two species of moth (A and P). Transects were set across the search area. Within transects, sections were identified according to habitat type.




This data frame contains the following columns:


length of transect


number of type A moths found


number of type P moths found


a factor with levels Bank, Disturbed, Lowerside, NEsoak, NWsoak, SEsoak, SWsoak, Upperside


Sharyn Wragg, formerly of Australian National University


print("Quasi Poisson Regression - Example 8.3")
rbind(table(moths[,4]), sapply(split(moths[,-4], moths$habitat), apply,2,
A.glm <- glm(formula = A ~ log(meters) + factor(habitat), family =
quasipoisson, data = moths)
  # Note the huge standard errors
moths$habitat <- relevel(moths$habitat, ref="Lowerside")
A.glm <- glm(A ~ habitat + log(meters), family=quasipoisson, data=moths)
## Consider as another possibility
A2.glm <- glm(formula = A ~ sqrt(meters) + factor(habitat), family =
                  quasipoisson(link=sqrt), data = moths)

Dataset imported from https://www.r-project.org.

Title Authored on Content type
OpenIntro Statistics Dataset - dream August 9, 2020 - 12:25 PM Dataset
OpenIntro Statistics Dataset - winery_cars August 9, 2020 - 2:38 PM Dataset
R Dataset / Package HSAUR / toothpaste March 9, 2018 - 1:06 PM Dataset
R Dataset / Package HSAUR / pottery March 9, 2018 - 1:06 PM Dataset
R Dataset / Package HistData / Guerry March 9, 2018 - 1:06 PM Dataset
<iframe src="https://r-data.pmagunia.com/iframe/r-dataset-package-daag-moths.html" frameBorder="0" width="100%" height="307px" />
Attachment Size
dataset-76376.csv 746 bytes
Dataset License
GNU General Public License v2.0
Documentation License
GNU General Public License v2.0

This documentation is licensed under GPLv3 or later.