khliland / pls

The pls R package
36 stars 3 forks source link

Possible improvement of the `explvar()` function to obtain the explained variance of y #37

Open AlvaroTorresMartos opened 9 months ago

AlvaroTorresMartos commented 9 months ago

The explvar() function automatically obtains the explained variance of each component of the PLS model. This function is useful for displaying information in tables or graphs.

To extract the variance explained by Y, a new argument variance = "Y" could be implemented. The default function will use the hypothetical variance = "X" argument to extract the variance explained by X for each component.

The summary() function already calculates the explained variance values of Y per component, but it does not provide this information automatically. Please inform me if it is possible to extract it.

khliland commented 8 months ago

Hi Alvaro,

I wonder if the R2() function satisfactorily covers this request? For printing, R2() can be used directly like MSEP() and RMSEP(), wrapped in plot(R2()) or for export/extraction with R2()$val.

Regards, Kristian