New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing values and weights #80

Closed
carlganz opened this Issue May 22, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@carlganz

carlganz commented May 22, 2017

Hello,

I find that that when mboost subsets to remove missing values here it fails to subset the weights so the dimensions don't line up down the road.

Example:

library(mboost)
# generate random data
set.seed(2017-5-22)

weights <- sample(1:100, 100, replace=FALSE)
x <- rnorm(100)
y <- runif(100)

# create missing value
x[25] <- NA

myData <- data.frame(x=x, y=y)

# errors
mboost(
  y ~ bols(x), 
  data = myData,
  weights = weights,
  family = Gaussian()
  )

# works
mboost(
  y ~ bols(x), 
  data = myData,
  weights = weights[-25],
  family = Gaussian()
)

# base R modeling functions subset weights
lm(y ~ x, myData, weights = weights)

Kind Regards,
Carl Ganz

@hofnerb hofnerb self-assigned this Jun 21, 2017

@hofnerb hofnerb added the bug label Jun 21, 2017

@hofnerb

This comment has been minimized.

Member

hofnerb commented Jun 21, 2017

You are absolutely right. Thanks for the bug report. I will immediately see how we can fix that.

@hofnerb hofnerb closed this in 6fd121e Jun 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment