Learn R Programming

smbdata (version 0.2.0)

airtemp: Air temperature

Description

Air temperature measurements (°C) recorded at approximately 9 a.m. on 100 days during 2006 using two instruments: a standard glass mercury dry-bulb thermometer and a new electronic dry-bulb thermistor probe. For each day, the dataset includes the day number and paired temperature readings from both devices, enabling direct comparison between the established and new measurement methods.

Usage

airtemp

Arguments

Format

A data frame with 100 rows and 4 variables:

Unit

Factor. Unique identifier for each observation.

DayNo

Integer. Day number on which the measurement was taken.

Mercury

Numeric. Temperature (in degrees Celsius) measured using a mercury thermometer.

Thermistor

Numeric. Temperature (in degrees Celsius) measured using a thermistor thermometer.

Examples

Run this code
# a simple linear regression
fit_ab <- lm(Thermistor ~ Mercury, data = airtemp)
# let intercept be 0
fit_b <- lm(Thermistor ~ 0 + Mercury, data = airtemp)
# test if intercept = 0
anova(fit_b, fit_ab)
# test if slope is equal to 1, given intercept = 0
fit_1 <- lm(Thermistor ~ 0 + offset(Mercury), data = airtemp)
anova(fit_1, fit_b)

Run the code above in your browser using DataLab