Different results Gamma generalized linear model R and SPSS

柔情痞子 提交于 2019-12-20 06:04:31

问题


Update: The p-values and S.E.'s are similar between SPSS and R if I change the parameter estimation method in SPSS to 'Hybrid' and the scale parameter method to 'Pearson Chi-square'. Does anyone now how to change these settings in R and what these settings actually mean?


I am trying to perform an GLM with a gamma log link function in R, to analyse a multiple imputation dataset.

However, when I compare the results from the same analysis in R and SPSS they are very different. This example is in a non-imputation dataset to make things easier to interpret. The SPSS result is as follows:

Parameter Estimates                         
Parameter   B   Std. Error  95% Wald Confidence Interval          Hypothesis Test       
        Lower   Upper   Wald Chi-Square df  Sig.
(Intercept) 3,263   ,2499   2,774   3,753   170,571 1   ,000
[Comorb=1]  -,631   ,1335   -,893   -,369   22,331  1   ,000
[Comorb=2]  -,371   ,1473   -,660   -,083   6,358   1   ,012
[Comorb=3]  0a  .   .   .   .   .   .
PAIDhoog     ,257   ,1283   ,006    ,509    4,023   1   ,045
PHQhoog    ,039 ,1504   -,256   ,334    ,068    1       ,794
[etndich=1,00]  -,085   ,1125   -,306   ,135    ,575    1   ,448
[etndich=2,00]  0a  .   .   .   .   .   .
Leeftijd    ,009    ,0035   ,002    ,016    6,588   1   ,010
(Scale) ,613b   ,0470   ,528    ,712            
Dependent Variable: totaalhealthcareutilization
Model: (Intercept), Comorb, PAIDhoog, PHQhoog, etndich, Leeftijd                            
a Set to zero because this parameter is redundant.                          
b Maximum likelihood estimate.                          

While the same analysis in R yields this result:

  Call:
glm(formula = (totaalhealthcareutilization) ~ PAIDhoog + PHQhoog + 
   Comorb + Leeftijd + etndich, family = Gamma(link = log), 
   data = F)

Deviance Residuals: 
   Min       1Q   Median       3Q      Max  
-2.1297  -0.7231  -0.3018   0.2075   3.1365  

Coefficients:
         Estimate Std. Error t value             Pr(>|t|)    
(Intercept)  3.006208   0.273817  10.979 < 0.0000000000000002 ***
PAIDhoog     0.201881   0.131777   1.532               0.1264    
PHQhoog      0.126989   0.157416   0.807               0.4203    
Comorbgeen  -0.638842   0.144459  -4.422            0.0000128 ***
Comorb1     -0.348187   0.158484  -2.197               0.0286 *  
Leeftijd     0.007311   0.003534   2.069               0.0392 *  
etndich      0.151836   0.118872   1.277               0.2023    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for Gamma family taken to be 0.9432289)

    Null deviance: 286.49  on 381  degrees of freedom
Residual deviance: 243.01  on 375  degrees of freedom
  (71 observations deleted due to missingness)
AIC: 3156

Number of Fisher Scoring iterations: 6

How is this possible? The results keep differing, even if I use na.omit or na.exclude in R. I have used the function 'relevel' in R, to make sure that the same reference category is used for the categoric variables.

I hope you have any idea what I am doing wrong in R.

 This is what a sample of my data looks like: 

   verrichtingen verpleegkanders Leeftijd HbA1c  BMI Type_Treat DurationDM
1               0               0       26    69 26.7    Insulin          5
2               0               0       69    75 34.5    Insulin         17
3               0               0       67    62 24.3    Insulin          1
4               6               0       38    96   NA    Insulin         10
5               0               0       29    NA 19.1    Insulin         25
6               0               0       50    86 37.9       Both          9
7               1               0       29    44 29.1       Both         33
451             4               0       68   113 37.9       Both         11
452            21               1       57    62 21.5    Insulin          1
453             0               0       37    54 25.4       Both         14
         Socstatus PAID1 PAID2 PAID3 PAID4 PAID5 PAIDtot PHQ1 PHQ2 PHQ3
1    wel achterstandsw     0     1     2     1     0       4    0    0    0
2   geen achterstandsw     2     1     1     2     0       6    0    0    0
3                 <NA>     0     0     0     0     0       0    0    0    0
4   geen achterstandsw     0     0     1     1     0       2    1    0    3
5   geen achterstandsw     0     0     0     0     0       0    1    1    3
6    wel achterstandsw     0     1     0     2     0       3    2    0    3
7   geen achterstandsw     1     1     2     3     0       7    1    1    3
451 geen achterstandsw     0     0     1     0     0       1    0    0    0
452  wel achterstandsw     1     0     4     1     0       6    2    0    3
453  wel achterstandsw     1     1     2     3     2       9    1    0    1
PHQ4 PHQ5 PHQ6 PHQ7 PHQ8 PHQ9 Geslacht        Etnicit HAPOH Bedrijfsarts MW
1      1    1    0    0    0    0    vrouw     Overigwest    NA           NA  NA
2      1    0    0    1    1    0      man            Mar    NA           NA NA
3      0    0    0    0    0    0      man     Overigwest    NA           NA NA
4      3    1    1    1    1    0    vrouw Overignietwest    NA           NA NA
5      0    0    0    3    0    0      man     Overigwest    NA           NA NA
6      1    1    1    0    0    0      man           Turk    NA           NA NA
7      3    0    0    2    0    0    vrouw     Overigwest    NA           NA NA
451    0    0    0    0    0    0      man              4    NA           NA NA
452    3    0    0    1    0    0    vrouw            Mar    NA           NA NA
453    2    2    0    0    0    0    vrouw            Mar    NA           NA NA
FysioErgo Diet Psychiat Psychol Dvk VPtot Internist Specialist ICUopname
1          NA    5        0       0   5     5         2          3         0
2          NA    2        0       0   2     2         3          8         0
3          NA    0        0       0   1     1         2          3         0
4          NA    0        1       2  11    11         6         25         0
5          NA    0        0       0   4     4         2          6         0
6          NA    1        0       0   2     2         2          0         0
7          NA    3        0       0   4     4         2          3         0
451        NA    0        0       0   1     1         3          7         0
452        NA    2        0       0   4     5         0         25         4
453        NA    1        0       0   2     2         0          5         0
Opnamegewoon SEH Comorb DMtype PAIDtotaal PHQtotaal PAIDhoog PHQhoog
1              0   0   geen    DM1          4         2        0       0
2              0   0   geen    DM2          6         3        0       0
3              0   0   geen    DM1          0         0        0       0
 4              1   0   geen    DM2          2        NA        0      NA
5              0   0   geen    DM1          0         8        0       0
6              0   0   geen    DM2          3         8        0       0
7              0   0   geen    DM2          7        10        0       0
451           18   2   <NA>    DM2          1         0        0       0
452           34   3   <NA>    DM1          6         9        0       0
453            0   0   <NA>    DM2          9         6        1       0
interactPHQPAID paidtotaalimp PHQtotaalimp GADtotaalimp PAIDhoogimp
1                 0             4            2            1           0
2                 0             6            3            0           0
3                 0             0            0            0           0
4                 0             2           11            2           0
5                 0             0            8            0           0
6                 0             3            8            0           0
7                 0             7           10            3           0
451               0             1            0            0           0
452               0             6            9            0           0
453               0             9            6            1           1
PHQhoogimp GADimphoog kostenopnames kosteninternist kostenspecialist
1            0          0             0             160              240
2            0          0             0             240              640
3            0          0             0             160              240
4            0          0           443             480             2000
5            0          0             0             160              480
6            0          0             0             160                0
7            0          1             0             160              240
451          0          0          7974             240              560
452          0          0         15062               0             2000
453          0          0             0               0              400
kostenhuisarts kostenMW kostenfysioergo kostendvk kostendietist
1               NA       NA              NA       240           240
2               NA       NA              NA        96            96
3               NA       NA              NA        48             0
4               NA       NA              NA       528             0
5               NA       NA              NA       192             0
6               NA       NA              NA        96            48
7               NA       NA              NA       192           144
451             NA       NA              NA        48             0
452             NA       NA              NA       192            96
453             NA       NA              NA        96            48
totaalkosten jaarHAPOH jaarbedrijfsarts jaarMW jaarfysioergo
1             NA        NA               NA     NA            NA
2             NA        NA               NA     NA            NA
3             NA        NA               NA     NA            NA
4             NA        NA               NA     NA            NA
5             NA        NA               NA     NA            NA
6             NA        NA               NA     NA            NA
7             NA        NA               NA     NA            NA
451           NA        NA               NA     NA            NA
452           NA        NA               NA     NA            NA
453           NA        NA               NA     NA            NA
totaalverbruikjaar kostenHAjaar kostenMWjaar kostenjaarfysioergo
1                   NA           NA           NA                  NA
2                   NA           NA           NA                  NA
3                   NA           NA           NA                  NA
4                   NA           NA           NA                  NA
5                   NA           NA           NA                  NA
6                   NA           NA           NA                  NA
7                   NA           NA           NA                  NA
451                 NA           NA           NA                  NA
452                 NA           NA           NA                  NA
453                 NA           NA           NA                  NA
kostenopnameICU kostenpsycholoog kostenpsychiater kostenvpanders
1                 0                0                0              0
2                 0                0                0              0
3                 0                0                0              0
4                 0              188               94              0
5                 0                0                0              0
6                 0                0                0              0
7                 0                0                0              0
451               0                0                0              0
452            8060                0                0             48
453               0                0                0              0
kostenverrichtingen totaalutilization kostenseh totaalkostennieuw hypoangst
1                     0                NA         0               880         1
2                     0                NA         0              1072         1
3                     0                NA         0               448         0
4                   876                NA         0              4609         0
5                     0                NA         0               832         0
6                     0                NA         0               304         1
7                   146                NA         0               882         5
451                 584                NA       518              9924         0
452                3066                NA       777             29301         0
453                   0                NA         0               544         3
contactprimarycare contactsecondarycare totaalhealthcareutilization
1                   NA                   15                          15
2                   NA                   15                          15
3                   NA                    6                           6
4                   NA                   52                          52
5                   NA                   12                          12
6                   NA                    5                           5
7                   NA                   13                          13
451                 NA                   35                          35
452                 NA                   94                          94
453                 NA                    8                           8
kostenprimarycare kostensecondarycare totaalkostenhealthcare etndich
1                  NA                 880                     NA       1
2                  NA                1072                     NA       2
3                  NA                 448                     NA       1
4                  NA                4609                     NA       2
5                  NA                 832                     NA       1
6                  NA                 304                     NA       2
7                  NA                 882                     NA       1
451                NA                9924                     NA       1
452                NA               29301                     NA       2
453                NA                 544                     NA       2

回答1:


The following reproduces your SPSS output.

Note, it's all a matter of setting the reference levels of the categorical variables correctly, to match the SPSS encoding. In R the first level will be used as the reference level.

df <- within(F, {
    Comorb <- relevel(Comorb, ref = "2 of meer");         # Reference level = "2 of meer"
    etndich <- factor(etndich, levels = 2:1);             # Reference level = 2
    PAIDhoog <- factor(PAIDhoog, levels = 1:0);           # Reference level = 1
    PHQhoog <- factor(PHQhoog, levels = 1:0);             # Reference level = 1
})

fit <- glm(formula = totaalhealthcareutilization ~ PAIDhoog + PHQhoog +
    Comorb + Leeftijd + etndich, family = Gamma(link = log),
    data = df)

summary(fit)
#
#Call:
#glm(formula = totaalhealthcareutilization ~ PAIDhoog + PHQhoog +
#    Comorb + Leeftijd + etndich, family = Gamma(link = log),
#    data = df)
#
#Deviance Residuals:
#    Min       1Q   Median       3Q      Max
#-2.1297  -0.7231  -0.3018   0.2075   3.1365
#
#Coefficients:
#             Estimate Std. Error t value Pr(>|t|)
#(Intercept)  3.638751   0.267741  13.591  < 2e-16 ***
#PAIDhoog0   -0.201881   0.131777  -1.532   0.1264
#PHQhoog0    -0.126989   0.157416  -0.807   0.4203
#Comorbgeen  -0.638842   0.144459  -4.422 1.28e-05 ***
#Comorb1     -0.348187   0.158484  -2.197   0.0286 *
#Leeftijd     0.007311   0.003534   2.069   0.0392 *
#etndich1    -0.151836   0.118872  -1.277   0.2023
#---
#Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#
#(Dispersion parameter for Gamma family taken to be 0.9432289)
#
#    Null deviance: 286.49  on 381  degrees of freedom
#Residual deviance: 243.01  on 375  degrees of freedom
#  (71 observations deleted due to missingness)
#AIC: 3156
#
#Number of Fisher Scoring iterations: 6

Compare with SPSS output

Parameter Estimates                         
Parameter   B   Std. Error  95% Wald Confidence Interval           Hypothesis Test      
        Lower   Upper   Wald Chi-Square df  Sig.
(Intercept) 3,639   ,2177   3,212   4,065   279,350 1   ,000
[PAIDhoog=0]    -,202   ,1056   -,409   ,005    3,657   1   ,056
 [PAIDhoog=1]   0a  .   .   .   .   .   .
[PHQhoog=0] -,127   ,1260   -,374   ,120    1,015   1   ,314
[PHQhoog=1] 0a  .   .   .   .   .   .
[Comorb=1]  -,639   ,1148   -,864   -,414   30,940  1   ,000
[Comorb=2]  -,348   ,1250   -,593   -,103   7,758   1   ,005
[Comorb=3]  0a  .   .   .   .   .   .
[etndich=1,00]  -,152   ,0936   -,335   ,032    2,633   1   ,105
[etndich=2,00]  0a  .   .   .   .   .   .
Leeftijd    ,007    ,0028   ,002    ,013    6,599   1   ,010
(Scale) ,581b   ,0387   ,510    ,662            
Dependent Variable: totaalhealthcareutilization
Model: (Intercept), PAIDhoog, PHQhoog, Comorb, etndich, Leeftijd                            
a Set to zero because this parameter is redundant.                          
b Maximum likelihood estimate.                       

Further comments on differences in the SPSS and glm output

  1. The first thing to note is that parameter estimates from SPSS and R are identical: Both parameter sets correspond to the (unique) set of maximum likelihood (ML) estimates given the model and data.

  2. In R, the standard errors are simply given as the square root of the diagonal elements of the estimated covariance matrix

    sqrt(diag(vcov(fit)))
    #(Intercept)   PAIDhoog0    PHQhoog0  Comorbgeen     Comorb1    Leeftijd
    #0.267740656 0.131776659 0.157416176 0.144458874 0.158484265 0.003534017
    #   etndich1
    #0.118871533
    

    Note that these values are identical to the reported se’s in summary(fit).

    I don’t know SPSS, but it seems that SPSS' se's correspond to scaled square roots of the diagonal elements of the variance-covariance matrix.

    Confidence intervals are based on parameter and variance-covariance estimates; as explained in the previous points, parameter estimates are identical, but SPSS uses a scaled variance-covariance matrix, so confidence intervals for the parameters in the SPSS and R output will be different according to said scaling factor.

    SPSS' documentation is regrettably diffuse, so I'm not sure how SPSS scales its variance-covariance matrix.


Sample data

F <- structure(list(HbA1c = c(69, 75, 62, 96, NA, 86, 44, 49, NA, 63, 43, 75, 48, 56, 79, 78, 67, 66, 75, 67, 65, 66, 34, 62, 79, 60, 91, 51, 84, 72, 65, NA, NA, 62, 61, 69, 63, NA, 85, 38, 42, 80, 59, 96, 59, 49, 62, 98, 71, 78, 50, 43, 44, 69, 56, 38, 59, 74, 115, 69, 67, 51, NA, 107, 71, 86, 78, 41, 60, 59, 74, 73, 49, 34, 71, 57, 55, 74, 67, 61, 48, 59, 70, NA, 55, 72, 69, 82, 40, 58, NA, 53, 46, 69, 60, 39, 76, 69, 61, 86, 58, 63, 66, 103, 73, 54, 59, 46, 58, 70, 57, 53, 49, 53, 58, 71, 60, 76, 64, 97, 60, 49, 53, 44, 53, 73, 59, 75, 61, 55, 68, 56, 51, 91, 92, 76, 51, 55, 61, 83, 52, 62, 71, 75, 54, 64, 90, 65, NA, 69, 70, 70, 59, 62, 60, 63, 58, 58, 63, 60, 49, 62, 95, 42, 99, 67, 117, 68, 55, 55, 70, 60, 61, 91, 33, 89, 60, 47, 62, 72, 40, 88, 59, 56, 57, 59, 74, 41, 53, 76, 48, 73, 65, 96, 58, 55, 67, 45, 45, 69, 72, 44, 59, 43, 90, 69, 69, 71, 93, 42, 87, 54, 83, 60, 48, NA, 53, 56, 57, 77, 63, NA, 63, 60, 68, 51, 48, 65, 61, 79, 63, 62, 53, 67, 53, 53, 63, 55, 61, 51, 53, 46, NA, 78, 76, 73, 51, 49, 68, 86, 71, 55, 57, 113, 63, 68, 94, NA, 38, 50, NA, 42, 60, 57, 49, 60, 81, 69, 55, 82, 64, 55, 74, 71, 56, 60, NA, 47, 49, 98, 55, 80, 71, 69, 35, 53, 90, 64, 82, 132, 64, 70, 65, 34, 65, 54, NA, 68, 58, 76, 82, 66, 74, 66, NA, 54, 53, 78, 62, 88, 69, 49, 83, 54, 55, 56, 66, 84, 47, 82, 53, 62, 163, 41, 55, 89, 76, 81, 45, 50, 89, 72, 90, 47, 38, 83, NA, 53, 74, 55, 47, 49, 56, 74, 107, 86, 48, 59, 86, 44, 55, 64, 81, 66, 63, 98, 51, NA, 60, 50, 55, 52, 79, 58, 50, 89, NA, 36, 50, 70, NA, 86, 57, 60, 78, 53, 70, 79, 49, 78, 83, 66, 57, 62, 80, 70, NA, 67, 80, 46, 79, 47, 145, 87, 53, 65, 73, 75, 53, 50, 71, NA, 65, 106, 123, 51, 55, 43, 48, 86, 61, 64, 55, 71, 61, 96, 80, 69, 66, 74, 88, 48, 68, 55, 52, 58, 69, 66, 44, 45, 64, 84, 72, 49, NA, 71, 70, 104, 78, 73, 47, 75, 45, 57, 88, 86, 55, 72, 47, 53, 113, 62, 54), BMI = c(26.7, 34.5, 24.3, NA, 19.1, 37.9, 29.1, 27.1, NA, 21.1, 48.5, 26.2, 26.9, NA, 25.5, 25.3, 44.3, 25.2, 26.7, NA, 25.5, 25.9, 31.2, 33, 21.8, 23.7, 32, 23.6, 32.4, 29.7, NA, 22.9, 24.4, 33.9, 35.4, 41.2, 20.4, NA, 30.1, 21, NA, NA, 29.5, 16.6, 38.1, 23.9, 19.1, 35.4, 24.2, NA, 26.1, 20, 28.7, 30.7, 25.4, 29.6, 25.4, 26.2, 18.3, 31, NA, NA, 31.5, 32, 35.6, 24.3, 33.3, 35.5, NA, 24.1, NA, 33.4, 28.4, NA, 25.9, 26.7, 35.5, 31.6, 25, 25.5, 22.2, 22.3, 23.4, 35.3, 26.1, 32.6, 20.9, 35.9, 29.1, 32.8, 32.2, 28.9, 28.9, 28.8, 19.7, 29.4, 28.8, 28.2, 20.9, 33.5, 17.6, 38.6, 27.1, NA, 29, 25.6, 22.5, 30.6, 35.6, 32.5, 23.4, 27.2, 23.6, 26.6, 23.5, 30.3, 30.6, 26.4, 38.1, 34.7, NA, 24.6, 22.2, 39.8, 23, 35.8, 31.4, 22.8, 29.3, 27, 31.1, NA, NA, 32.4, 36, NA, 52.8, 22, 27.1, 23.3, 22.7, 25, 42.6, 30.2, 25.3, 30.5, 25.3, 28.4, 30.1, 32.4, NA, 32, 18.8, 23.1, 28.5, 25.1, 22.8, 23.6, 18.5, NA, 27.1, 25.3, 19.8, 20.8, 32.7, 30.1, 34.8, 37.5, NA, 28.1, 46, 23.5, 26.3, 22.2, 28.2, 29.3, 24.2, 29.7, 28.9, 28, 31.3, 28.6, 29.1, 28.4, 23.1, 34.9, 22.7, 26.9, 28.9, 35.9, 23, 25.8, 22.8, 19.2, 27.9, 29.2, 35, 25.1, 20.5, 23.9, 34.3, 23.1, 25.1, 20.5, 24.6, 24.4, 23.7, 22.4, 40.1, 21.9, 50, 34.2, 30.5, 20.7, 29.3, 32.6, 32.1, 23.9, NA, 34, 22.6, 30.2, 28.6, 27.5, 33, 24, 28.8, NA, 32.8, 21.8, NA, 37.8, 26.4, 36.2, 20.8, 24.4, 31, 31.9, 27.6, 25.4, 22.7, NA, 27.7, 32.4, 34, 26.2, 26.7, 23.7, 32, 24.1, 35.8, 23.5, 38.9, 35.3, NA, 23.9, 30.2, 24.4, 24.4, 27.9, NA, 25.7, 25.6, 25.8, 47.9, 25.6, 36.1, NA, 24.2, 24.8, 21.4, 22.3, 24.3, 24.7, 22.5, 25.9, 30.1, 27.4, 27.8, 22.6, 24.4, NA, 33.8, 41.9, 21.4, 32.5, 41.1, 27.2, NA, 37.8, 29, 23.2, 28.7, 25.2, 32.6, 29, 24.4, 23.1, 22.8, 23.1, 39.8, 26.6, 25.3, 53.5, 25, 22.9, 22.2, 30.2, 27.4, 27.4, NA, 25.2, 22.4, 20.2, 23.9, 23.3, 31.2, 24, 23.5, 38.8, 30, 30.6, 28.9, 23.1, 34.4, 28.7, 30.8, 21.6, 24.1, 25.5, 39.2, 29.3, 36.2, 28.3, NA, NA, NA, 29.5, 33.1, 23.4, 23.5, 25.1, 34.4, 24.5, 29.7, 22.2, 25.5, 23.3, 37.5, 26.8, 44.5, 32.4, 26.1, 21.4, 26.5, 32.7, 26.9, NA, 27.4, 36.3, 25.1, 37.7, NA, 27.6, 24.2, 46.9, 30.8, 29.3, 25.4, 35.7, 36.8, 35, 22.3, 28.3, 20.4, 25, 35, NA, 39.4, 25.2, 22.5, 34.5, NA, 21.6, 30.1, 25, NA, 28.3, 19.7, 22.3, 33.2, NA, 24.6, 23.9, 22.8, 24.1, 31.7, 28.4, 34.5, 30.1, 33.3, 28, 38, 35.9, 30.6, 33.5, 29.5, 21.4, 24.4, 27.5, 31.7, 23.8, NA, 21.8, 28.7, 33.5, 23.5, 27.3, 28.7, NA, 25.6, 26.7, 44.8, 26.2, 27.1, 39.7, 24.1, 21.3, 29.5, 30, NA, 27, NA, 23.6, 22.3, 32.6, 51.9, 27.7, 28.7, 35.2, 27.2, 29.6, 22.8, 19.6, 25.7, 28.3, 31.2, 21.7, 36.2, 26.9, 37.9, 21.5, 25.4), Comorb = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L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, 0, NA, 0, 0, 0, 0, 0, 1, NA, 0, 1, 1, 0, 0, NA, 0, 0, 1, 1, 0, 0, 0, NA, 0, 1, 0, 0, 0, 0), totaalhealthcareutilization = c(15, 15, 6, 52, 12, 5, 13, 15, 13, 8, 10, 4, 9, 8, 6, 5, 8, 42, 15, 21, 6.3, 9, 5, 5, 14, 24, 8, 15, 25, 12, 29, 21, 6, 11, 8, 7, 29, 7, 7, 19, 14, 25, 16, 7, 20, 13, 17, 12, 5, NA, 9, 11, 14, 57, 12, 10, 37, 8, 12, 57, 8, 11, 14, 11, 49, 10, 10, 11, 19, 20, 21, 5, 1, 2, 2, 3, 3, 6, 4, 3, 4, 6, 5, 4, 4, 5, 7, 6, 6, 8, 5, 7, 8, 5, 6, 6, 6, 8, 7, 6, 6, 9, 11, 7, 9, 7, 7, 7, 7, 8, 10, 10, 10, 9, 9, 9, 11, 8, 10, 9, 9, 11, 13, 8, 12, 12, 9, 11, 7, 8, 10, 10, 9, 10, 10, 12, 12, 16, 9, 5, 10, 7, 13, 13, 13, 15, 16, 11, 11, 17, 13, 12, 22, 19, 15, 14, 11, 12, 19, 13, 15, 13, 14, 11, 17, 12, 17, 10, 13, 15, 12, 13, 13, 20, 16, 21, 17, 25, 22, 18, 18, 17, 15, 19, 10, 15, 20, 33, 22, 26, 23, 27, 20, 21, 21, 13, 24, 45, 27, 27, 19, 19, 25, 43, 16, 16, 13, 24, 29, 17, 24, 25, 32, 27, 29, 22, 35, 56, 26, 45, 23, 54, 26, 33, 23, 39, 35, 24, 36, 37, 37, 74, 53, 36, 60, 33, 35, 26, 44, 78, 22, 26, 77, 62, 121, 51, 28, 68, 63, 43, 64, 81, 120, 95, 98, 23, 11, 21, 10, 7, 41, 7, 33, 6, 40, 20, 2, 31, 23, 23, 13, 68, 9, 8, 41, 19, 27, 29, 46, NA, 35, 16, 12, 9, 14, 20, 7, 2, 4, 6, 6, 6, 4, 9, 6, 8, 9, 12, 9, 7, 8, 12, 11, 11, 14, 12, 14, 12, 16, 15, 22, 23, 19, 11, 12, 13, 17, 18, 19, 27, 15, 9, 17, 18, 19, 17, 19, 12, 16, 54, 21, 30, 23, 25, 24, 37, 35, 27, 47, 22, 27, 27, 30, 32, 32, 31, 39, 28, 36, 54, 50, 45, 42, 88, 56, 63, 82, 60, 70, 139, 122, 71, 130, 84, 33, 111, 111, 246, 157, 54, 24, 41, 22, 7, 33, 15, 9, 6, 16, 67, 3, 22, 48, 15, 57, 25, 48, 74, 40, 25, 18, 21, 3, 6, 7, 7, 14, 9, 11, 16, 14, 14, 14, 28, 18, 22, 21, 26, 39, 24, 22, 18, 22, 19, 19, 45, 15, 13, 22, 31, 29, 46, 37, 23, 35, 68, 39, 51, 35, 50, 80, 69, 51, 41, 90, 43, 32, 48, 34, 53, 25, 66, 39, 83, 70, 237, 81, 126, 95, 170, 35, 94, 8), etndich = c(1, 2, 1, 2, 1, 2, 1, 1, NA, 1, 1, 1, 1, 1, NA, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, NA, 2, 1, NA, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NA, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, NA, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, NA, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2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57, 75, 43, 46, 35, 65, 29, 29, 75, 49, 31, 57, 29, 40, 75, 30, 34, 58, 47, 37, 43, 34, 47, 46, 42, 49, 57, 46, 36, 51, 80, 45, 47, 48, 23, 51, 53, 44, 64, 44, 33, 40, 42, 29, 60, 28, 47, 47, 39, 25, 41, 39, 27, 57, 66, 42, 22, 59, 27, 43, 53, 65, 52, 41, 50, 55, 29, 55, 39, 41, 25, 74, 68, 55, 29, 77, 45, 18, 34, 49, 74, 44, 33, 48, 82, 61, 54, 46, 30, 33, 65, 51, 44, 50, 57, 27, 56, 85, 52, 31, 62, 62, 34, 48, 28, 28, 63, 30, 40, 44, 37, 73, 70, 39, 59, 56, 61, 40, 43, 33, 58, 44, 62, 26, 72, 67, 59, 48, 37, 52, 37, 57, 53, 59, 44, 71, 81, 33, 61, 50, 33, 48, 50, 63, 46, 60, 58, 40, 63, 39, 71, 38, 40, 56, 36, 52, 61, 83, 59, 43, 69, 50, 57, 38, 50, 27, 43, 46, 30, 50, 34, 68, 53, 48, 84, 41, 57, 61, 72, 27, 80, 71, 69, 61, 43, 67, 60, 58, 67, 72, 40, 79, 52, 80, 33, 25, 80, 67, 56, 66, 54, 50, 65, 39, 36, 69, 39, 34, 41, 36, 61, 33, 42, 43, 45, 48, 67, 69, 66, 37, 28, 64, 65, 68, 62, 84, 82, 59, 61, 74, 52, 41, 30, 33, 55, 55, 26, 53, 33, 64, 65, 74, 67, 70, 58, 51, 62, 67, 52, 40, 57, 57, 57, 59, 56, 61, 58, 45, 63, 61, 50, 70, 32, 50, 74, 70, 49, 42, 71, 51, 67, 46, 45, 75, 54, 75, 45, 46, 64, 60, 55, 61, 65, 68, 71, 43, 78, 53, 63, 85, 75, 66, 67, 54, 63, 68, 84, 58, 72, 70, 58, 29, 63, 83, 64, 75, 59, 76, 61, 62, 65, 61, 72, 20, 43, 67, 33, 62, 63, 51, 34, 68, 68, 60, 67, 44, 64, 69, 53, 69, 47, 41, 38, 57, 71, 70, 68, 25, 60, 71, 48, 64, 62, 72, 60, 45, 67, 59, 73, 27, 64, 66, 57, 72, 71, 77, 58, 56, 65, 74, 44, 22, 63, 42, 80, 52, 66, 60, 56, 54, 42, 68, 57, 37)), .Names = c("HbA1c", "BMI", "Comorb", "PAIDhoog", "PHQhoog", "totaalhealthcareutilization", "etndich", "Leeftijd"), row.names = c(NA, -453L), variable.labels = structure(c("HbA1c", "BMI level", "", "", "", "", "", ""), .Names = c("HbA1c", "BMI", "Comorb", "PAIDhoog", "PHQhoog", "totaalhealthcareutilization", "etndich", "Leeftijd")), codepage = 65001L, class = "data.frame")


来源:https://stackoverflow.com/questions/51423002/different-results-gamma-generalized-linear-model-r-and-spss

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!