Skip to content

Hard coded variable name x should be avoided #46

@mronkko

Description

@mronkko

Please specify whether your issue is about:

  • [x ] a possible bug
  • a question about package functionality
  • a suggested code or documentation change, improvement to the code, or feature request

The summary method has a hard coded variable name x. This is problematic: x is quite commonly used as the name for a predictor variable when teaching regression. If we have x as a predictor, the summary method incorrectly selects the predictors as the predicted value and vice versa.

Put your code here:

## load package
library("prediction")

## code goes here

set.seed(12345)
N <- 200

x <- rnorm(N)
y <- x+rnorm(N)

m1 <- lm(y ~ x)

p1 <- prediction(m1, at=list(x=-3:3))
summary(p1)

## session info for your system
sessionInfo()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions