Laura M.

asked • 04/07/21

Multivariate regression R output not displaying coefficient values for each variable in the model

When I run the summary(fit2), I only get output showing the intercept and coefficient for the first variable. How can I get the coefficient values for all variables in the model?

mydata = read_sav(file = "NHANES_RN1.sav")
mydata$BCAR_log <- log(mydata$BCAR)
hist(mydata$BCAR_log, breaks = 70)
mydata$SBP_log <- log(mydata$SBP)
hist(mydata$SBP_log, breaks = 70)

fit2 <- lm(SBP_log ~ BCAR_log, + Exactage + Male + RaceEthnicity1, data = mydata)
summary(fit2)

Call: lm(formula = SBP_log ~ BCAR_log, data = mydata, subset = +Exactage + Male + RaceEthnicity1)

Residuals: Min 1Q Median 3Q Max -0.36816 -0.11586 -0.03979 0.11913 0.53596

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

(Intercept) 4.863132 0.008112 599.467 < 2e-16 BCAR_log -0.008751 0.003048 -2.871 0.00411

r


Muhammad R.

Your model looks fine to me and I believe it should display the complete output. If you want me to look into this problem, you can share your data and code.
Report

04/14/21

David B.

fine? what part of Call: lm(formula = SBP_log ~ BCAR_log, data = mydata, subset = +Exactage + Male + RaceEthnicity1), is fine? the data was split to treat three of the four separate variables as subsets of the BCAR_log for goodness sake! Says so right in the output! One extra comma after BCAR_log, did the trick. Clues were all over the place.
Report

05/22/21

1 Expert Answer

By:

David B. answered • 05/22/21

Tutor
5.0 (257)

Math and Statistics need not be scary

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.