Stores results from a locally weighted regression (loess) with groups model fitted to data with groups (D.B. Baird).

### Options

`RMETHOD` = string token |
Type of residuals to form if parameter `RESIDUALS` is set (`deviance` , `si` `mple` ); default `devi` |

`SAVE` = identifier |
Save structure from the analysis of a loess with groups model by `RLOESSGROUPS` ; default uses the model fitted most recently by `RLOESSGROUPS` |

### Parameters

`RESIDUALS` = variates |
Residuals, as specified by the `RMETHOD` option |

`FITTEDVALUES` = variates |
Fitted values |

`LEVERAGES` = variate |
Leverages of the units |

`ESTIMATES` = variates |
Estimates of parameters |

`SE` = variates |
Standard errors of the estimates |

`VCOVARIANCE` = symmetric matrix |
Variance-covariance matrix of the estimates |

`CORRELATIONS` = symmetric matrix |
Correlation matrix of the estimates |

`DEVIANCE` = scalars |
Residual ss or deviance |

`DF` = scalar |
Residual degrees of freedom |

`ACCUMULATED` = pointer |
Saves the accumulated analysis-of-variance (or deviance) table as a pointer with a variate or text for each column (source, d.f. etc) |

### Description

`RKLOESSGROUPS`

allows you save information from an analysis `RLOESSGROUPS`

, which fits a locally weighted regression (loess) analysis with groups. You do not need to declare the data structures to save the information in advance; Genstat will declare them automatically to be of the correct type and length.

The `RESIDUALS`

,`FITTEDVALUES`

and`LEVERAGES`

parameters save the standardized residuals, fitted values and leverages. The`RMETHOD`

option controls the type of residuals that are formed.

The `ESTIMATES`

and`SE`

parameters save the parameter estimates and their standard errors.`RKLOESSGROUPS`

puts them into variates, in the same order as in the display produced by the`PRINT`

option `RLOESSGROUPS`

.

The `VCOVARIANCE`

parameter saves the variance-covariance matrix of the estimates. These are formed by multiplying the inverse matrix by the relevant variance estimate based on the estimated dispersion, or on the dispersion that you have supplied in the original `MODEL`

statement. The `CORRELATIONS`

parameter saves the correlations matrix of the estimates.

The `DEVIANCE`

parameter lets you save the residual sum of squares, or the *deviance*for distributions other than Normal. The`DF`

parameter saves the residual degrees of freedom.

The `ACCUMULATED`

parameter saves the accumulated analysis-of-variance (or deviance) table. The accumulated table is saved as a pointer with a variate or text for each of its columns (source, d.f. etc). Note that the suffixes of`ACCUMULATED`

for the last 4 columns in the pointer depend on whether it is an analysis of variance (`'s.s.'`

, `'m.s.'`

, `'v.r.'`

, `'F pr.'`

) or an analysis of deviance (`'deviance'`

, `'mean dev.'`

, `'dev. r.'`

, `'approx F pr.'`

).

Options:

`RMETHOD`

,`SAVE`

.

Parameters:`RESIDUALS`

,`FITTEDVALUES`

,`LEVERAGES`

,`ESTIMATES`

,`SE`

,`VCOVARIANCE`

,`CORRELATIONS`

,`DEVIANCE`

,`DF`

,`ACCUMULATED`

.

### See also

Directive: `RKEEP`

.

Procedures: `RLOESSGROUPS`

, `RDLOESSGROUPS`

.

Commands for: Regression analysis.

### Example

CAPTION 'RKLOESSGROUPS example',\ 'Yield of sugar beet vs soil phosphate in 4 years'; STYLE=major,plain FACTOR [LEVELS=4; VALUES=16(1...4)] Year OPEN '%EXAMPLES%/GuidePart2/beet.dat'; CHANNEL=2 READ [PRINT=*; CHANNEL=2] Beetwt,%sugar,SoilP CLOSE 2 CALCULATE Sugar = Beetwt * %sugar / 100 MODEL Sugar RLOESSGROUPS SoilP; GROUP=Year; SMOOTH=2 RKLOESSGROUPS RESIDUALS=res; FITTEDVALUES=fit; LEVERAGE=lev; ESTIMATES=est; SE=se PRINT Year,Sugar,SoilP,res,fit,lev; DEC=0,5(*) PRINT est,se