Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7497251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:00:06+00:00 2026-05-29T19:00:06+00:00

If I do data(mtcars) m1 <- lm(mpg ~ cyl, data= mtcars, x= TRUE, y=

  • 0

If I do

data(mtcars)
m1 <- lm(mpg ~ cyl, data= mtcars, x= TRUE, y= TRUE)

then I can extract the p-value for the slope using summary(m1)$coefficients[2, 4].

But if I do

library(rms)
data(mtcars)
m2 <- ols(mpg ~ cyl, data= mtcars, x= TRUE, y= TRUE)

what do I need to do to extract the p-value for the slope?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:00:08+00:00Added an answer on May 29, 2026 at 7:00 pm

    You can use the corresponding extractor function, but you need to call summary.lm:

    > coef(summary.lm(m2))
              Estimate Std. Error   t value     Pr(>|t|)
    Intercept 37.88458  2.0738436 18.267808 8.369155e-18
    cyl       -2.87579  0.3224089 -8.919699 6.112687e-10
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We can draw box plot as below: qplot(factor(cyl), mpg, data = mtcars, geom =
If you run: mod <- lm(mpg ~ factor(cyl), data=mtcars) It runs, because lm knows
From the online bar chart guide : qplot(factor(cyl), data=mtcars, geom=bar, fill=factor(gear)) How do I
Here's a plot: library(ggplot2) ggplot(mtcars, aes(x = factor(cyl), y = hp, group = factor(am),
Is this possible to reproduce this lattice plot with ggplot2? library(latticeExtra) data(mtcars) x <-
Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But
Data-aware controls can be linked to datasets to display data contained in fields in
Data structure is a dictionary, each value is another dictionary, like: >>> from lib
I'm usually using reshape package to aggregate some data (d'uh), usually with plyr ,
Data table structure is: id1,id2,id3,id4,... (some other fields). I want to create summary query

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.