Last data update: 2014.03.03

R: Weight Loss Data from an Obese Patient
wtlossR Documentation

Weight Loss Data from an Obese Patient

Description

The data frame gives the weight, in kilograms, of an obese patient at 52 time points over an 8 month period of a weight rehabilitation programme.

Usage

wtloss

Format

This data frame contains the following columns:

Days

time in days since the start of the programme.

Weight

weight in kilograms of the patient.

Source

Dr T. Davies, Adelaide.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

Examples

wtloss.fm <- nls(Weight ~ b0 + b1*2^(-Days/th),
    data = wtloss, start = list(b0=90, b1=95, th=120))
wtloss.fm
plot(wtloss)
with(wtloss, lines(Days, fitted(wtloss.fm)))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MASS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MASS/wtloss.Rd_%03d_medium.png", width=480, height=480)
> ### Name: wtloss
> ### Title: Weight Loss Data from an Obese Patient
> ### Aliases: wtloss
> ### Keywords: datasets
> 
> ### ** Examples
> 
> wtloss.fm <- nls(Weight ~ b0 + b1*2^(-Days/th),
+     data = wtloss, start = list(b0=90, b1=95, th=120))
> wtloss.fm
Nonlinear regression model
  model: Weight ~ b0 + b1 * 2^(-Days/th)
   data: wtloss
    b0     b1     th 
 81.37 102.68 141.91 
 residual sum-of-squares: 39.24

Number of iterations to convergence: 3 
Achieved convergence tolerance: 4.324e-06
> plot(wtloss)
> with(wtloss, lines(Days, fitted(wtloss.fm)))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>