Skip to content
TheChatArchiveThe Chat Archive
Qwenqwen3-235b-a22b-no-thinking· Alibaba (Qwen)Hugging Face LMArena Human Preference 140K

provide a list of medium sized R databases that will be used to perform a regression of…

  1. User

    provide a list of medium sized R databases that will be used to perform a regression of a predicted variable consisting of counts, and predictors that are NOT categorical

  2. Qwen Assistant

    When performing a regression where the response variable consists of counts, and the predictors are not categorical, you're likely looking at Poisson regression, negative binomial regression, or other count-based models. In R, there are several built-in and contributed datasets that can be used for such purposes.

    Below is a list of medium-sized datasets in R (base or commonly-used packages) that are suitable for regression with count response variables and continuous predictors:


    🔹 1. quakes (base R)

    • Description: Locations of 1000 seismic events (earthquakes) near Fiji.
    • Response (Y): depth or stations (could be treated as count).
    • Predictors (X): Latitude, longitude (continuous), magnitude.
    • Use case: Predict number of stations recording an earthquake (stations) based on location and magnitude.
    • Size: 1000 rows, 5 columns
    data(quakes)
    head(quakes)
    

    🔹 2. discoveries (base R)

    • Description: The number of great inventions and scientific discoveries in each year from 1860 to 1959.
    • Response (Y): discoveries (count)
    • Predictors (X): Year (can be transformed into continuous time variable)
    • Use case: Time series regression of discovery counts over time.
    • Size: 100 rows, 1 column
    data(discoveries)
    plot(discoveries)
    

    🔹 3. Insurance (MASS package)

    • Description: Data from a Swedish insurance company showing the number of claims per policyholder.
    • Response (Y): Claims (count)
    • Predictors (X): Kilometres driven, Bonus, Make (but can filter/remove categorical variables)
    • Use case: Model number of insurance claims using continuous predictors like distance driven.
    • Size: 63 rows, 5 columns
    library(MASS)
    data(Insurance)
    head(Insurance)
    

    🔹 4. bioChemists (pscl package)

    • Description: Number of articles published by graduate students in biochemistry.
    • Response (Y): art (number of articles published – count)
    • Predictors (X): ment (number of articles mentored – continuous), phd, mar, etc.
    • Use case: Poisson or negative binomial regression predicting publication count.
    • Size: 915 rows, 7 columns
    library(pscl)
    data(bioChemists)
    head(bioChemists)
    

    🔹 5. RecreationDemand (AER package)

    • Description: Recreation demand at a lake; includes number of trips taken.
    • Response (Y): trips (count)
    • Predictors (X): Cost variables (e.g., income, cost, out_of_pocket_cost)
    • Use case: Model recreation demand (count data) using economic and demographic factors.
    • Size: 659 rows, 7 columns
    library(AER)
    data(RecreationDemand)
    head(RecreationDemand)
    

    🔹 6. CrabSatellites (MASS package)

    • Description: Number of satellites (male crabs) around female horseshoe crabs.
    • Response (Y): satellites (count)
    • Predictors (X): Size, weight (continuous), color (categorical – can exclude)
    • Use case: Count regression predicting satellite presence.
    • Size: 173 rows, 8 columns
    library(MASS)
    data(crabs)
    CrabSatellites <- crabs
    head(CrabSatellites)
    

    ✅ Summary Table

    DatasetPackageResponseContinuous PredictorsRowsNotes
    quakesbasestationslat, long, mag1000Location-based prediction
    discoveriesbasediscoveriesyear100Time-series count modeling
    InsuranceMASSClaimsKilometres, Bonus63Insurance claim modeling
    bioChemistspsclartment, phd, mar915Publication count analysis
    RecreationDemandAERtripscost, income659Economic modeling
    CrabSatellitesMASSsatellitessize, weight173Ecological / biological modeling

    Let me know if you'd like code examples for fitting a Poisson or negative binomial model on any of these datasets!