Run R

Submitted by: Submitted by

Views: 125

Words: 624

Pages: 3

Category: Other Topics

Date Submitted: 06/10/2013 09:04 AM

Report This Essay

Answers

1-(b)

> inference(data = bv1960$blackreg, group = bv1960$dv, est = "mean", type = "ht", null = 0 ,alternative = "greater", order = c("bstate","dstate"), method = "theoretical")

Response variable: numerical, Explanatory variable: categorical

Difference between two means

Summary statistics:

n_bstate = 423, mean_bstate = 34.7187, sd_bstate = 23.4563

n_dstate = 660, mean_dstate = 25.703, sd_dstate = 24.225

Observed difference between means (bstate-dstate) = 9.0156

H0: mu_bstate - mu_dstate = 0

HA: mu_bstate - mu_dstate > 0

Standard error = 1.48

Test statistic: Z = 6.092

p-value = 0

2-(1)

> lm2=lm(blackreg~dv, data=bv1960)

> summary(lm2)

Call:

lm(formula = blackreg ~ dv, data = bv1960)

Residuals:

Min 1Q Median 3Q Max

-34.719 -17.719 -4.719 11.297 73.297

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 34.719 1.163 29.84 <2e-16 ***

dvdstate -9.016 1.490 -6.05 2e-09 ***

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 23.93 on 1081 degrees of freedom

(53 observations deleted due to missingness)

Multiple R-squared: 0.03275, Adjusted R-squared: 0.03185

F-statistic: 36.6 on 1 and 1081 DF, p-value: 1.999e-09

3-(a)

1.

> lm1=lm(blackreg~strigh48, data=bv1960)

> summary(lm1)

Call:

lm(formula = blackreg ~ strigh48, data = bv1960)

Residuals:

Min 1Q Median 3Q Max

-37.393 -13.750 -5.245 9.782 83.926

Coefficients:

Estimate Std. Error t value Pr(>|t|)

(Intercept) 37.3930 0.9313 40.15 <2e-16 ***

strigh48 -0.2937 0.0225 -13.05 <2e-16 ***

---

Signif. codes: 0 ‘***’...