# Search results

1. ### Make me pretty (Density Plot)

In the below figure, I would like the word 'Density', not to be on the graph. So by default it includes the var name. Any suggestions? diff_1 = rnorm(250, 30, 5) Density = diff_1 p <- mcmc_areas( data.frame(Density), prob = 0.95, # 80% intervals prob_outer = 0.999, # 99% point_est =...
2. ### 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...
3. ### 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...
4. ### 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...
5. ### 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 <-...
6. ### 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
7. ### 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...
8. ### 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...
9. ### Linear Regression Alternatives if DV Zero Bounded

Any suggestions how to proceed when dependent variable (lab value) is zero bounded. See below:
10. ### 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 =...
11. ### 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...
12. ### 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...
13. ### 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...
14. ### 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...
15. ### 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...
16. ### 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...
17. ### 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
18. ### 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...
19. ### 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...
20. ### 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...