Skip to main content

New answers tagged

0 votes

How to model the impact of cancellations on case resolution times in the legal department considering different stages and contract characteristics?

This is an interesting problem (to me!). On the one hand, we seem to have time-to-event data, indicating a survival-type model. On the other hand, it seems that "cases" can move "...
Robert Long's user avatar
  • 62.4k
2 votes

General Linear Mixed Model: How do I fix 'Rescale variables? Model is nearly unidentifiable' error on glmer

This kind of problem, in my experience, is an indication that the model is misspecified. In this particular scenario, a couple of things spring to mind: First visualise the data It is quite common ...
Robert Long's user avatar
  • 62.4k
0 votes

How do you interpret estimates when the model is the same for two exposure variables?

First, we outline the graphical and modeling assumptions, followed by the causal queries to be examined: Assumptions: The graph (DAG on the left) accurately represents all relevant direct causal ...
Johan de Aguas's user avatar
3 votes

Finding independent predictors with multiple logistic regression

This is primarily a futile analyses as the dataset does not possess the needed information to make the needed judgements. You’ll see this when you bootstrap the importance ranks of predictors, or ...
Frank Harrell's user avatar
0 votes

How to get from cubic spline to natural cubic spline?

Since the function must be linear before the first knot, it leads to $$\beta_2=\beta_3=0$$ because all of the knot terms will be 0 before the 1st knot. In order for the answer to be more general, let'...
Maverick Meerkat's user avatar
3 votes

Finding independent predictors with multiple logistic regression

Can you do this? Yes. Is it a good idea? Probably not. You will wind up testing a lot of models. If you are choosing 2 at a time from 14 (which is, I think, what you are doing) you will have $(14\...
Peter Flom's user avatar
  • 124k
2 votes

Poisson regression given multiple predictors on a repeating ID variable

There are roughly 30K ZIP codes in the US, though not all of these have people in them who are at risk of dying. Let's say you have 20K ZIPs with people at risk your data in your data. You seem to ...
dimitriy's user avatar
  • 36.4k
7 votes

Count predictor and binary outcome

Is a binary logistic regression the best approach when I have a count predictor and a binary outcome? It is certainly one valid approach, probably the most common one. Is it "best"? That ...
Peter Flom's user avatar
  • 124k
0 votes
Accepted

How reasonable is it to divide an offset by an integer to make the model non-singular?

The use of the offset is completely wrong. The offset functions like a variable for which no coefficient is estimated as it is equal to one by definition. It is a repeated measures design, in that the ...
Rahul's user avatar
  • 13
9 votes

Count predictor and binary outcome

Per your questions... Is a binary logistic regression the best approach when I have a count predictor and a binary outcome? Yes. Logistic regression handles any linear equation which requires the ...
Shawn Hemelstrand's user avatar
1 vote

GLS combined with Random Effect

Is it reasonable to use a random effect for ID (to account for different intercept per individual) plus generalized least squares (to account for different variability per individual)? I think there ...
Robert Long's user avatar
  • 62.4k
2 votes
Accepted

Can you use a percentage as the dependent variable in general additive models?

Certainly. Probably the easiest implementation is to use the family = betar() argument, which fits models of proportions that range between zero and one. An example ...
Shawn Hemelstrand's user avatar
0 votes

How to determine the confidence intervals for the principal axes of a second-rank tensor?

The description is quite long, so I may have missed something. So you have a tensor $\mathbf{k}=k^{ij}\mathbf{e_i}\otimes \mathbf{e_j}$, $k^{ij}=k^{ji}$. You then are interested in the projection of ...
Cryo's user avatar
  • 698
3 votes

In Regression Through the Origin, why do the CIs of the slope depend on datapoints with zero x value?

This type of datapoint is actually very helpful for estimating the variance This is quite unsurprising when you think a bit more about it. Just as it is a very different thing to estimate a mean and ...
Ben's user avatar
  • 127k
2 votes
Accepted

Manual selection of parameters and features and bad results by gridsearch

Intelligent application of your understanding of the subject matter is usually superior to hoping that some automated system will give you the best model. With only 65 samples, you probably can only ...
EdM's user avatar
  • 94.5k
9 votes

Are dichotomous categorical variables technically interval/continuous measures?

I disagree and yet in a limited sense also I agree with that (currently) unsourced statement. Binary (indicator, dichotomous, Boolean, logical, one-hot, quantal) variables coded as 0 and 1 are ...
Nick Cox's user avatar
  • 58k
0 votes

Interpreting and reporting gamm4 result

You’ve done a good job fitting a Generalised Additive Mixed Model (GAMM) using the gamm4 function to explore the relationship between ...
Robert Long's user avatar
  • 62.4k
1 vote

Merging an administrative dataset with survey data in the context of a regression discontinuity design: what things should I consider?

Common issues with administrative data are that the variable definitions are not what you would have used if you were collecting the data for this purpose ('concept') or that the same nominal time ...
Thomas Lumley's user avatar
0 votes
Accepted

Data mining for categorical variables that correspond to modes of a continuous variable

I ended up using regression trees for this and had way more success with tree based models than step-wise linear regression.
noNameTed's user avatar
  • 153
5 votes

How to improve a model with little dataset?

If the linear models perform the best, and there are no serious mis-specifications present, then there is nothing to improve. Machine learning methods do not necessarily beat vanilla regressions, and ...
Shawn Hemelstrand's user avatar
0 votes

Regression with known upper bounds and lower bounds of predicted variables

It sounds like what you want is tobit regression, which is designed for data exactly like yours, where any predicted values above an upper bounds are set to that upper bound and values below a lower ...
Noah's user avatar
  • 34.5k
0 votes
Accepted

No Multicollinearity between highly Correlated IVs

There is multicollinearity, but it just doesn't rise to the level that most would consider problematic. In an ordinary least squares model, the variance inflation factor (VIF) for predictor i is $$ \...
EdM's user avatar
  • 94.5k
7 votes

Linear regression: interpret coefficient in terms of percentage change when the outcome variable is a count number

No, you cannot interpret $b_1$ as a percentage. To simplify the argument, say $X_2 = 0$. (Any fixed value for $X_2$ will do.) In this case, the regression equation becomes $Y = a + b_1X_1$. Let's look ...
dipetkov's user avatar
  • 10.4k
2 votes

Difference between regression methods

For the question of When to use logistic regression and when to use beta regression in statistical modeling for given data? A logistic regression is most commonly used when modelling a response ...
den173's user avatar
  • 66
2 votes

Underdispersion handled with negative binomial distribution?

No I don't believe that the standard negative binomial distribution could ever be a valid model for under dispersed data, as I believe that $\theta < 0$ produces an invalid variance function. ...
den173's user avatar
  • 66
1 vote

Multi-level Linear Mixed Model: Sampling and Power Issues

There is a lot of stuff going on here. I'll try my best to answer your question, but I don't know if I can sufficiently answer everything. First off, I see that you have simply kicked out your missing ...
Shawn Hemelstrand's user avatar
0 votes

Least Squares Derivation

I found this post because in my notes there is that exact $\chi^2(\theta)$ function as the cost function to minimize for the least squares method (i come from physics too). About the nomenclature i ...
Pierpaolo Vesce's user avatar
0 votes

Lifelines-CoxTimeVaryingFitter for Multistate Survival Analysis

I'm not very familiar with the Python lifelines package, and questions that are very software specific are off topic on this site. Here's a bit of guidance, or ...
EdM's user avatar
  • 94.5k
3 votes

Incorporate retest reliability into model (in R)

It seems to me that it is already incorporated. It is one form of noise, or measurement error. This is similar to any measurement that is not highly reliable, either on cross-sectional analysis or in ...
Peter Flom's user avatar
  • 124k
1 vote

In a mixed model with intersubject and intrasubject variable what random effects should i put?

Your syntax here is correct. This models crossed random effects between subjects and stimuli (which is good because all subjects are subject to all stimuli here). You might also be able to sneak ...
Shawn Hemelstrand's user avatar
3 votes

Choose to resolve and report only some hypotheses

Think about it like this. Suppose you are a mechanic trying to fix a car. You decide that, based off previous intakes you have done, you will try Fix A, Fix B, and Fix C for this situation. After the ...
Shawn Hemelstrand's user avatar
6 votes

Confidence int. expands much more rapidly than prediction int. as we depart from $\bar X$

I think the reason is that the prediction intervals are dominated by the variance term from the future observation, at least as long we are not too far from the mean. The formulas from the link in ...
kjetil b halvorsen's user avatar
7 votes
Accepted

Confidence int. expands much more rapidly than prediction int. as we depart from $\bar X$

Remember that the width of the intervals is based on the estimate of the standard deviation of what we are predicting. For the confidence interval that is just the standard error of the predicted ...
Greg Snow's user avatar
  • 52.2k
3 votes

McFadden's Pseudo-$R^2$ Interpretation

The measures summarized here have advantages over McFadden’s pseudo $R^2$. My new favorite measure is a pseudo adjusted $R^2$ that is very close to the traditional adjusted $R^2$ when the model is ...
Frank Harrell's user avatar
4 votes

VIF/GVIF for binary logistic regression

Before getting to the VIF/GVIF, you have a lot of predictors in your model. I would ensure that 1) they are theoretically relevant and 2) you have enough data to estimate this model. But that is a ...
Shawn Hemelstrand's user avatar
2 votes

Autoregressive cross-lagged models

I will note that there are both statistical and theoretical ways to look at this, so I express the statistical part here first. Assuming your model isn't mis-specified somehow (omitted variable bias, ...
Shawn Hemelstrand's user avatar
2 votes
Accepted

t-value of regression intercept

It's because $H_{0}$ is not the null model ($i.e. y=\beta_{0}$). $H_{0}$ is something like: The true value $\beta_{0}$ is 0(, while the true value $\beta_{1}$ doesn't have to be 0). We use t-test here,...
Xiaoci YU's user avatar
0 votes

Combining coefficients from linear regression

You might be better off using a hierarchical model. If your sample size is too large, you can use the split sample approach. Here is an extract from an article by Molenberghs, Verbeke and Iddi (2011) ...
Pardon's user avatar
  • 1
3 votes

What is the variance of a regression after t generations?

Hi: The notation subscripting is sometimes important. In this case, it doesn't matter but the model should be written as $x_{t+1} = b x_{t} + \epsilon_{t+1}$ because the $\epsilon_t$ should be time ...
mlofton's user avatar
  • 2,557
2 votes
Accepted

What is the variance of a regression after t generations?

If $|b|<1$, the process $\{x_t\}_{t=0}^\infty$ is weak-sense stationary, so $\operatorname{var}(x_t)=v$ does not change in time, and it is the solution of $v = b^2v + \sigma^2$, so: $$ \...
Johan de Aguas's user avatar
3 votes
Accepted

Online updating of $t$-value for simple linear regression

Define n, sx, sy, sxx, sxy, syy \begin{align}s_x & = \sum{x_i},\\s_y &= \sum{y_i}, \\s_{xx} &= \sum{(x_i \times x_i)}, \\s_{yy} &= \sum{(y_i \times y_i)}, \\s_{xy} & = \sum{(x_i \...
wei's user avatar
  • 643
2 votes

Calculate combined confidence interval of two variables in a negative binomial model (in R)

Reading your comments in Peter's answer, it appears you are just interested in the interaction between time in years and treatment. It seems pretty straightforward that this can just be entered as an ...
Shawn Hemelstrand's user avatar
2 votes

dispersion of a negative binomial model

we also need to consider overdispersion for a normal distribution, but it is often stated there is no overdispersion in gaussian models. This can be related to the following difference: For the ...
Sextus Empiricus's user avatar
2 votes

Calculate combined confidence interval of two variables in a negative binomial model (in R)

Your formula for adding variances is correct. But the result may not make much sense. A binary variable can be coded as anything: 0 and 1 or -1 and 1 or 1 and 2019 or whatever. And each choice will ...
Peter Flom's user avatar
  • 124k
4 votes

dispersion of a negative binomial model

Your primary question seems to be this one: Given that $\theta$ can be freely adjusted, does it make sense to test, e.g., $H_0: \phi = 1$? Two methods one can use for the Poisson are the score test ...
Shawn Hemelstrand's user avatar
0 votes

dispersion of a negative binomial model

Ignore what summaries with $\theta = 1$ say and with a reasonable amount of data you can estimate $\theta$ from the data. The dispersion parameter $\theta$ in this parameterization is describing how ...
Björn's user avatar
  • 33.2k
0 votes

Counterexample where E(u|x)=0 in a regression model cannot hold in the population?

The problem you are describing is due to the fact literature for some reason unknown to me restricts mathematical or statistical models to algebraic expressions. However if we look from a more broader ...
Cagdas Ozgenc's user avatar
1 vote
Accepted

How to address multicollinearity when adding random effects in gam model and include random slopes?

You have asked a lot of different complicated questions, and this question could indeed use some more focus, but I will do my best to answer them as much as possible given how difficult modeling GAMs ...
Shawn Hemelstrand's user avatar
1 vote

Running a multilevel model without level-1 predictors

For whatever reason, the bot bumped this post. While Jeremy is correct, I would also add that while there may not be level-1 predictors or the data for it, in many cases, aggregate data exists at ...
JewJitsu11B's user avatar
4 votes

ordinal logistic regression with multicollinearity among the independent continuous variables

First, if $C = C1 + C2 + C3$ then you have perfect collinearity and the regression will "blow up". You need to eliminate at least one of these variables. This is true for any kind of ...
Peter Flom's user avatar
  • 124k

Top 50 recent answers are included