ich komm gleich zur Sache:
erklärt werden soll eine Variable (h1bvis.supp), die die Werte 0, 0.25, 0.5, 0.75, 1 aufweist. Als Prädiktoren gibt es zum einen eine Faktorvariable "group" (mit 4 Gruppen, codiert mit 0,1,2,3), eine Geschlechtsvariable "female" (0= männlich, 1= weiblich), eine Altersvariable "age", sowie zwei kontinuierliche Variablen "expl.prejud" & "impl.prejud" ( jeweils im Wertebereichl [0,1] ).
Die Variablen sind Teil des df "immigr".
Wenn ich nun eine multiple Regression rechne, bekomm ich folgendes Output:
Code: Alles auswählen
model2_multivar <- lm(h1bvis.supp ~ age + female + group, data = immigr)
> summary(model2_multivar)
Call:
lm(formula = h1bvis.supp ~ age + female + group, data = immigr)
Residuals:
Min 1Q Median 3Q Max
-0.47610 -0.29411 -0.04017 0.18504 0.78581
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.4333751 0.0481809 8.995 < 2e-16 ***
age -0.0024797 0.0006035 -4.109 4.26e-05 ***
female -0.0753644 0.0187888 -4.011 6.45e-05 ***
groupwhitecollar 0.1312694 0.0554447 2.368 0.0181 *
groupother 0.0759781 0.0414958 1.831 0.0674 .
groupunemployed 0.0898415 0.0413621 2.172 0.0301 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.2967 on 1116 degrees of freedom
(11 observations deleted due to missingness)
Multiple R-squared: 0.02889, Adjusted R-squared: 0.02454
F-statistic: 6.641 on 5 and 1116 DF, p-value: 4.189e-06
Code: Alles auswählen
length(model2_multivar$coefficients)
[1] 6
info noch zu den datentypen:
Code: Alles auswählen
str(immigr)
'data.frame': 1133 obs. of 10 variables:
$ h1bvis.supp : num 1 0.75 0.25 0 0 0.5 0 0.5 1 0 ...
$ indimm.supp : num 1 0.75 0.25 0 0.25 0.25 0 0 0 0 ...
$ employed : int 1 0 0 0 0 1 0 0 0 0 ...
$ female : int 1 0 1 0 1 1 1 1 0 0 ...
$ age : int 31 64 69 49 51 61 64 47 67 43 ...
$ expl.prejud : num 0.3 0.35 0.25 0.85 NA ...
$ impl.prejud : num 0.337 0.57 0.597 0.74 NA ...
$ nontech.whitcol: int 1 0 0 0 0 0 0 0 0 0 ...
$ tech.whitcol : int 0 0 0 0 0 0 0 0 0 0 ...
$ group : Factor w/ 4 levels "tech","whitecollar",..: 2 4 4 4 4 3 4 4 4 4 ...
Ursprünglich hat der df so ausgesehen:
Code: Alles auswählen
str(immigr)
'data.frame': 1133 obs. of 10 variables:
$ h1bvis.supp : Factor w/ 5 levels "0","0.25","0.5",..: 5 4 2 1 1 3 1 3 5 1 ...
$ indimm.supp : Factor w/ 5 levels "0","0.25","0.5",..: 5 4 2 1 2 2 1 1 1 1 ...
$ employed : int 1 0 0 0 0 1 0 0 0 0 ...
$ female : int 1 0 1 0 1 1 1 1 0 0 ...
$ age : int 31 64 69 49 51 61 64 47 67 43 ...
$ expl.prejud : Factor w/ 21 levels "0","0.050000001",..: 7 8 6 18 NA 6 NA 10 12 NA ...
$ impl.prejud : Factor w/ 1009 levels "0.030460104",..: 84 457 527 856 NA 197 NA 82 25 NA ...
$ nontech.whitcol: int 1 0 0 0 0 0 0 0 0 0 ...
$ tech.whitcol : int 0 0 0 0 0 0 0 0 0 0 ...