Learn R Programming

pheno (version 1.5)

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.
  • fixed.levLevels of fixed effects. Should be the same order as fixed effects.
  • randomEstimated random effects, in phenology these are the station effects.
  • random.levLevels of random effects. Should be the same order as random 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.
  • DThe input as ordered data frame, ordered first by f2 then by f1
  • fitThe fitted lme model object.

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. Note that the input data is sorted before fitting, such that subsequent analyses using the input data should be done using the sorted output data frame.

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