Exclude cases pairwise in linear regression

Discuss statistics related things
Post Reply
Abbot
Posts: 2
Joined: Fri Aug 25, 2023 7:59 am

Exclude cases pairwise in linear regression

Post by Abbot »

Hi, I´m new to Jamovi, have used SPSS for 20 years or so. We mainly use SPSS for linear regression, t-tests, study of correlations etc. When we use linear regression the default setting in SPSS is to exclude cases listwise but we almost allways change the setting to pairwise exclusion.

I can se that Jamovi by deafault uses listwise exclusion in linear regressions. Is it possible to change that to pairwise exclusion and how do I do that?
User avatar
jonathon
Posts: 2627
Joined: Fri Jan 27, 2017 10:04 am

Re: Exclude cases pairwise in linear regression

Post by jonathon »

if spss does pairwise exclusion for linear regression ... well ... i have no idea what it would be doing.

maybe someone else knows.

jonathon
Abbot
Posts: 2
Joined: Fri Aug 25, 2023 7:59 am

Re: Exclude cases pairwise in linear regression

Post by Abbot »

Hi again,
In listwise deletion a case is dropped from an analysis because it has a missing value in at least one of the specified variables. The analysis is only run on cases which have a complete set of data.

Pairwise deletion occurs when the statistical procedure uses cases that contain some missing data. The procedure cannot include a particular variable when it has a missing value, but it can still use the case when analyzing other variables with non-missing values. A case may contain 3 variables: VAR1, VAR2, and VAR3. A case may have a missing value for VAR1, but this does not prevent some statistical procedures from using the same case to analyze variables VAR2 and VAR3. Pairwise deletion allows you to use more of your data. However, each computed statistic may be based on a different subset of cases. This can be problematic. For example, a correlation matrix computed using pairwise deletion may not be positive semidefinite. That is, it may have negative eigenvalues, which can create problems for various statistical analyses. This can occur because when correlations are computed using different cases, the resulting patterns can be ones that are impossible to produce with complete data.
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: Exclude cases pairwise in linear regression

Post by MAgojam »

Abbot wrote: Fri Aug 25, 2023 9:20 am I can se that Jamovi by deafault uses listwise exclusion in linear regressions. Is it possible to change that to pairwise exclusion and how do I do that?
Hey @Abbot,
jamovi uses listwise deletion in linear regression, pairwise deletion is not yet supported.
This is due to the fact that under the hood of jamovi there are many powerful R functions.
For linear regression the stats::lm() function works, as you can see its call in the source code here:
https://github.com/jamovi/jmv/blob/mast ... #L179-L195
The stats::lm() function only wants complete observations (listwise deletion).

Consider Norman Matloff's suggestion here if you wish:
https://github.com/matloff/regtools/blob/master/R/AC.R

With a few lines of R code in jamovi's Rj module, you can take advantage of the fact that R's stats::cov() function offers a use=pairwise.complete.obs argument option, which applies (Available Cases) to find covariance matrices, which in turn can be used to estimate the regression coefficients.

Check out the screenshot with jamovi vs. SPSS for a small Anderson's Iris DataSet:
ScreenShot_20230826231657.jpeg
ScreenShot_20230826231657.jpeg (709.13 KiB) Viewed 8575 times
Cheers,
Maurizio
Post Reply