Search results

  1. hlsmith

    pvalue Model Terms

    So if I simulate a bunch of random independent variables and select one as the DV and the rest as IVs, I should expect 1 in 20 will be significant at p value </= 0.05 as the number of terms increases toward infinity, right? By chance, the number of significant terms may be higher than 1\20 at...
  2. hlsmith

    Bayesian Interrupted Time Series

    @Dason I have questions regarding some JAGS code I am trying to adapt. I will start off with trying to change the listed priors. Below is the code I am using. This fits a time series that is interrupted. So outputs an intercept, slope and second intercept and second slope as well as the...
  3. hlsmith

    Linear vs. Non-Linear Functions

    I am curious on your thoughts on linear vs. nonlinear functions. So I am referring to the projection of the dependent variable into space as a function of covariates. When is it linear vs. non-linear (including a line or in a hyperplane). In linear regression if there isn't a polynomial and...
  4. hlsmith

    Creating an Expression Tree

    I am trying to get this not to look like garbage. Any suggestions? Stole most of the code from the internet (partially from some raptor sympathizer named @trinker ) parseTree <- function(string, ignore=c('(',')','{','}'), ...) { dat <- utils::getParseData(parse(text=string)) g <-...
  5. hlsmith

    TS - Book Club

    Well this is my 10K post - so I thought I would use it to say that in the book Hail Mary by Andy Weir... THE WHOLE THING IS A DREAM spoiler alert @Dason
  6. hlsmith

    External Model Validation

    Trying to get some input on my below process/method to validate a prediction model! I have a sample of 200 peoples' dependent variable (positive continuous lab value) and days since an exposure (independent value). I fit a GLM with dist=gamma and link=log. From this I get a model coefficient...
  7. hlsmith

    Multiplicative Change

    Hey, I am still playing around with the gamma reg with log link. The model kicks out a coefficient for my continuous IV. I can then exp the coefficient to get the multiplicative change in the DV. In an estimate statement I can get the estimate for different values of the IV. I was curious if...
  8. hlsmith

    Linear Regression Alternatives if DV Zero Bounded

    Any suggestions how to proceed when dependent variable (lab value) is zero bounded. See below:
  9. hlsmith

    Prob Biden Wins WI in 2020

    I did this quick for @Dason! ################################################ # Monte Carlo Simulation B = 1630337 T = 1609640 Tot_counted = B + T Counted_Per = 0.97 State_Tot = Tot / Counted_Per Outstanding = State_Tot - Tot Lead = B - T N = 100000 set.seed(2020) y_rbeta <- rbeta(N, shape1 =...
  10. hlsmith

    Percent Portion of Logged DV

    Well my brain is not on today. I have a continuous outcome, I was going to run a regression where if a categorical variable's coefficient(X1) was greater than 110% of the reference group (intercept) my hypothesis would not be supported. Since this is a non-inferiority hypothesis and bigger...
  11. hlsmith

    ROPE value in Bayesian Regression

    I am fitting a Bayesian regression model. The outcome is continuous (patient length of stay; a little skewed) and the independent variable is binary (treatment; y/n). There are a couple of covariates (continuous) in the model as well. I wanted to test that patients in the treatment group do not...
  12. hlsmith

    Bayesian proxy to Huber-White Estimators

    I am working on a study where a very small portion of the sample contribute more than one observation. I was wondering if there was a Bayesian proxy to the Huber-White estimator or robust regression? I was actually planning on using non-informative priors since it is novel research and there...
  13. hlsmith

    Bayesian Prediction Intervals

    I have been thinking about this every once and awhile - also i will acknowledge that I havent tried to look up the answer myself yet. I thought, I would throw it out here at TS and see what you have to say. Say i am running a Bayesian regression model based on MCMC. I end up with a posterior...
  14. hlsmith

    Metrics to compare series

    Say I have two series that are related, fictitious example: # marriages and # divorces. So the counts in the second series is a subset of the first series. Now an exogenous boost happened that changed the counts (dampened the accumulation) in the first series and this is now seen in the second...
  15. hlsmith

    Plotting a new series on top of old

    Well, I don't quite have a solution in my brain or way to phrase this for a WWW search. I 'plot' a series (x = time, y = count) in base plot, then I run "par(new = TRUE)" and plot a new series (x=time, y = count/n) on top of the old and label the second y-axis accordingly to account for units...
  16. hlsmith

    Series of doubled numbers

    I am looking for a way to double a number (i.e., "3") until I get to around 3 million; resulting in a series that I can plot. Solution: 3, 6, 12, 24, 48, 96,..., ~3M
  17. hlsmith

    Association estimate (partial reverse temporality)

    I have a project where i modeled variables associated with a target variable. I used logistic regression. My issue is that covariates are causes of the target and some are effects. This seems bizzarre and is regularly done in the field of medicine. Say i am looking at an injury and variables...
  18. hlsmith

    COVID19 Infographics

    Hello all, I created this thread to compile interesting COVID19 graphics, charts, depictions, even comics. Please keep it tasteful and educational. Below is the mother of all graphics and the GitHub data source...
  19. hlsmith

    Repeated Measures

    I will acknowledge that I dont get a lot of repeated measures data. Someone is working on getting me some data. Simplified, it will consist of a treatment variable, binary(X), and a continuous outcome for subjects across time. People will likely get the same treatment across time (X=0) up until...
  20. hlsmith

    Correcting Probabilities for Artificially Balanced Data

    I have data from a frequency matched case-control study. All that needs to be known about that is the outcome variable is artificially balanced (50:50), when the true ratio is actually (10:90). When you run logistic regression on these data all outputs are correct (if generalized to the original...