Learn R Programming

pheno (version 1.0)

pheno.mlm.fit: Fits a two-way linear mixed model

Description

Fits a two-way linear mixed model. The model assumes the first factor f1 to be fixed and the second factor f2 to be random. Errors are assumed to be i.i.d. No general mean and sum of f2 is constrained to be zero.

Usage

pheno.mlm.fit(D)

Arguments

D
Data frame with three columns (x, f1, f2) or a matrix where rows are ranks of factor f1 levels and columns are ranks of factor f2 levels and missing values are set to 0.

Value

  • fixedEstimated fixed effects, in phenology this is precisely the combined time series.
  • randomEstimated random effects, in phenology these are the station effects.
  • SEf1Standard error group f1, i.e. square root of variance component fixed effect.
  • SEf2Standard error group f2, i.e. square root of variance component random effect.
  • lclfLower 95 percent confidence limit of fixed effects.
  • uclfUpper 95 percent confidence limit of fixed effects.

Details

This function is basically a wrapper for the lme() function of the nlme package, adapted for the estimation of combined phenological time series. Estimation method: restricted maximum likelihood (REML) In phenological application, x should be the julian day of observation of a certain phase, factor f1 should be the observation year and factor f2 should be a station-id.

References

Searle (1997) 'Linear Models'. Wiley. Schaber J, Badeck F-W (2002) 'Evaluation of methods for the combination of phenological time series and outlier detection'. Tree Physiology 22:973-982

See Also

lme

Examples

Run this code
data(DWD)
	R <- pheno.mlm.fit(DWD)								# parameter estimation
	plot(levels(factor(DWD[[2]])),R$fixed,type="l")		# plot combined time series
	tr <- lm(R$fixed~rank(levels(factor(DWD[[2]]))))	# trend estimation
	summary(tr)$coef[2]									# slope of trend
	summary(tr)$coef[4]									# standard error of trend

Run the code above in your browser using DataLab