Coder Social home page Coder Social logo

Comments (2)

harrelfe avatar harrelfe commented on August 17, 2024

To be consistent should that not be

|P <- if(length(idf)) 2 * pt(-abs(Z), idf)) else 2 * pnorm(-abs(Z)) |

On 09/30/2015 11:48 AM, Alexander Ploner wrote:

The function |contrast.rms| reports the p-values for all Wald
statistics absolutely larger than ca. 9 as an exact zero.

Example adapted from the |contrast.rms| help page with Z=10.36:

|set.seed(1) x = rnorm(500) xb = 1+2*x y = ifelse(runif(500) <=
plogis(xb), 1, 0) f = lrm(y ~ x) ct = contrast(f, list(x=1)) ct
ct$P==0 ## Exact zero |

The problem seems to be the line below in |contrast.s| where the
p-value is calculated:

|P <- if(length(idf)) 2 * (1 - pt(abs(Z), idf)) else 2 * (1 -
pnorm(abs(Z))) |

Replacing this with

|P <- if(length(idf)) 2 * (1 - pt(abs(Z), idf)) else 2 * pnorm(-abs(Z)) |

should do the trick.

|rms 4.3-1 _ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system
x86_64, mingw32 status major 3 minor 2.2 year 2015 month 08 day 14 svn
rev 69053 language R version.string R version 3.2.2 (2015-08-14)
nickname Fire Safety |


Reply to this email directly or view it on GitHub
#13.


Frank E Harrell Jr Professor and Chairman School of Medicine

Department of *Biostatistics*   *Vanderbilt University*

from rms.

alexploner avatar alexploner commented on August 17, 2024

Of course! Sorry, completely blinded to dfs :) /alexander

On 2015-09-30 19:16, Frank Harrell wrote:

To be consistent should that not be

|P <- if(length(idf)) 2 * pt(-abs(Z), idf)) else 2 * pnorm(-abs(Z)) |

On 09/30/2015 11:48 AM, Alexander Ploner wrote:

The function |contrast.rms| reports the p-values for all Wald
statistics absolutely larger than ca. 9 as an exact zero.

Example adapted from the |contrast.rms| help page with Z=10.36:

|set.seed(1) x = rnorm(500) xb = 1+2*x y = ifelse(runif(500) <=
plogis(xb), 1, 0) f = lrm(y ~ x) ct = contrast(f, list(x=1)) ct
ct$P==0 ## Exact zero |

The problem seems to be the line below in |contrast.s| where the
p-value is calculated:

|P <- if(length(idf)) 2 * (1 - pt(abs(Z), idf)) else 2 * (1 -
pnorm(abs(Z))) |

Replacing this with

|P <- if(length(idf)) 2 * (1 - pt(abs(Z), idf)) else 2 *
pnorm(-abs(Z)) |

should do the trick.

|rms 4.3-1 _ platform x86_64-w64-mingw32 arch x86_64 os mingw32 system
x86_64, mingw32 status major 3 minor 2.2 year 2015 month 08 day 14 svn
rev 69053 language R version.string R version 3.2.2 (2015-08-14)
nickname Fire Safety |


Reply to this email directly or view it on GitHub
#13.


Frank E Harrell Jr Professor and Chairman School of Medicine

Department of Biostatistics Vanderbilt University


Reply to this email directly or view it on GitHub
#13 (comment).

Alexander Ploner
Medical Epidemiology & Biostatistics
Karolinska Institutet
http://ki.se/meb

from rms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.