
Laura M.
asked 04/07/21Multivariate 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?
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
1 Expert Answer

David B. answered 05/22/21
Math and Statistics need not be scary
Hi Laura, it is a shame when some people look for reasons not to answer rather than find the answer. I'm thinking that the other person who commented just may not have known what the problem was.
One doesn't always need the dataset to be able to find the problem. the problem was in this line.
You had inserted a comma after the BCAR_log, which cut off the model at that point. The other variables were ignored (actually , treated as subsets). This (below) is the correct line. Now the code should run correctly and show the coefficients for all the variables.
Good luck. I hope you aren't turned off by less capable responses. We all make mistakes.
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
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.04/14/21