Giter VIP home page Giter VIP logo

brokenstick's People

Contributors

stefvanbuuren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brokenstick's Issues

Left boundary knot different from first internal knot

When not specified, the default left boundary knot is calculated as the minimum age in the data. The left boundary knot may then become lower than knots[1]. Consequences are:

  1. lmer() may remove x1 from the analysis with fit warnings: fixed-effect model matrix is rank deficient so dropping 1 column
  2. plot(fit, ...) may fail with Error in X %*% beta : non-conformable arguments

The problem can be circumvented by manually specifying the boundary argument so that knots[1] == boundary[1], but in general this is unwanted behaviour.

Actions to take:

  1. Produce an example of unwanted behaviour.
  2. The brokenstick() should be programmed in a way to ensure that knots[1] == boundary[1], so that fit warning does not occur.
  3. The plot(fit, ...) should test for knots[1] == boundary[1], and exit gracefully.

more than two predictors

How do I add more than two predictors : 1) Age 2) BMI in the brokenstick model and how do I ensure that the knots function is only for Age variable and not BMI ? Thanks.

install_github fails

There are some intricate undeclared dependencies I need to sort out. I uninstalled tibble, lazyeval, brokenstick, rbokeh and wash, and could then successfully run

install.packages("devtools")
library("devtools")
Sys.setenv(GITHUB_PAT = "your-key-here")

install.packages("tibble")
devtools::install_github("stefvanbuuren/brokenstick")

brokenstick() ignores the last observation

The default setting in for the Boundary.knots argument of brokenstick() (2.5.0) ignores the data in the last, rightmost observation in a specific situation.

The default Boundary.knots are set as follows (from the JSS paper):

These conditions require that Boundary.knots span at least the range of the data. This requirement is easy to achieve by setting Boundary.knots = range(data$age), which is done by default. Also, we need to ensure that the range of knots is not outside Boundary.knots. We may achieve that by setting Boundary.knots to include at least range(knots).

Somewhat unexpectedly, the current version ignores the data from the last knot if these show no age variation (i.e. if all observations are made at the same time). This may occur when the data have been pre-arranged or rounded into waves.

A quick solution is to manually set the right boundary knot slightly higher than the last knot value. For example, if the knots = c(0, ..., 10) then set boundary = c(0, 11).

Ideally, the procedure should test for this case, and adapt the default.

plotting imputed trajectories

Dear Stef,
I have an issue with trying to plot multiply imputed trajectories based on the brokenstick model. I get the following error message
Error in FUN(X[[i]], ...) : object 'hgt_z' not found
which I think is related to this code chunk from plot_trajectory() where you refer to "hgt_z" which is named differently in my analysis.
k <- data$.source == "imputed" if (any(k)) { g <- g + ggplot2::geom_line(ggplot2::aes_string(group = ".imp"), data = data[k, ], color = color_imp[2L]) + ggplot2::geom_point(ggplot2::aes_string(y = "**hgt_z**"), data = data[k, ], color = color_imp[1L], size = size_imp) }
If I rename my outcome variable to hgt_z everything works fine.
Kind regards
Ben

Height and Weight data beyond

Stef,

I am looking for some additional child height and weight data for other countries that I could use in an introductory data science class. Do you happen to have any leads to additional public data?

Here is the one you describe in the package.

Longitudinal height and weight measurements during ages 0-2 years for a representative sample of 1933 Dutch children born in 1988-1989. The dataset smocc_hgtwgt is a subset of the full data covering the first 206 children.

Thanks,

J.

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.