Commit 1f27adc3 authored by Thomas Friedrichsmeier's avatar Thomas Friedrichsmeier
Browse files

Add ANOVA table option to linear regression plugin

parent 4dadc2b7
Pipeline #171887 passed with stage
in 2 minutes and 44 seconds
......@@ -2,12 +2,12 @@ TODOs:
- More tolerant handshake on Windows? Simply a matter of allowing more time?
- Allow vector of names in require()
- Add option to show ANOVA table for linear regression
- Add default preview() function is available to plugins, reducing the code needed to add preview functionality
- Add preview functionality to most existing plugins that did not have it, yet
- Better placement of messages in non-plot preview windows
- Fixed some problems with cancelling running commands
- Package installation uses inline widget to provide progress feedback, instead of separate dialogs
- TODO: Remove "Ok" button from dialog, rename "Cancel" to "Close"
- TODO: Remove current repositories from .rk.get.package.installation.status() (no longer needed)
- Package installation no longer uses an external process, unless required for root permissions
- Fixed: Package installation as root would fail to find kdesu/kdesudo on recent systems
......
......@@ -10,7 +10,8 @@ function calculate () {
var savemodel = getBoolean ("savemodel.active");
var savefitted = getBoolean ("savefitted.active");
var saveresiduals = getBoolean ("saveresiduals.active");
var simple_mode = !(savefitted || saveresiduals || savemodel);
var anova = getBoolean("anova");
var simple_mode = !(savefitted || saveresiduals || savemodel || anova);
model = 'lm (' + getValue ("y") + ' ~ ' + intercept + vars;
if (!simple_mode) model += ', na.action=na.exclude'; // default action of na.omit is a nuisance for fitted values
......@@ -25,6 +26,7 @@ function calculate () {
if (savefitted) echo ('.GlobalEnv$' + getString ('savefitted') + ' <- fitted (model)\n');
if (saveresiduals) echo ('.GlobalEnv$' + getString ('saveresiduals') + ' <- residuals (model)\n');
echo ('results <- summary (model)\n');
if (anova) echo ('results_anova <- anova (model)\n');
}
}
......@@ -33,4 +35,5 @@ function printout (is_preview) {
echo ('rk.header (' + i18n ("Linear Regression") + ')\n');
}
echo ('rk.print(results)\n');
if (getBoolean("anova")) echo ('rk.print(results_anova)\n');
}
......@@ -14,6 +14,7 @@
<setting id="x">One or more independent variables, each of the same length as the dependent. Note that factor variables are treated as categorial predictors, while numeric variables are treated as continuous predictors, automatically.</setting>
<setting id="intercept">Should an intercept term be included in the model?</setting>
<setting id="beta">Print standardized correlation coefficients? This requires the lm.beta package.</setting>
<setting id="anova">Show an analysis of variance table.</setting>
<caption id="tab_save"/>
<setting id="savemodel">Save the full fitted model.</setting>
<setting id="savefitted">Extract and save predicted values from the model.</setting>
......
......@@ -12,6 +12,7 @@
<varslot types="numeric" id="x" source="vars" required="true" multi="true" label="independent variables"/>
<checkbox id="intercept" label="Include intercept" checked="true"/>
<checkbox id="beta" label="Show standardized coefficients" checked="false"/>
<checkbox id="anova" label="Show ANOVA table" checked="false"/>
<stretch/>
<preview id="preview" mode="output"/>
</column>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment