New answers tagged

0 votes

Limitations to generalized additive model (GAM)

Probably one of the biggest limitations to GAMs is that they cannot model complex regression paths that involve multiple responses or things like mediation paths. Structural equation modeling (SEM) ...
1 vote

t.test on bootstrapped estimates

The bootstrap is a valid approach, but the t-test is not valid. One simple approach is to take the quantiles of the difference of the sample metrics and test whether that confidence interval includes ...
  • 4,263
1 vote

t.test on bootstrapped estimates

Here is the problem with this approach: It is incredibly sensitive to the number of bootstraps. Suppose that the null is true (the population variances between the two samples really are equal). I ...
1 vote

How could I estimate a transition probability matrix that varies over time?

If the transition probability matrix varies over time then your stochastic process is not a Markov chain (i.e., it does not obey the Markov property). In order to estimate transition probabilities at ...
  • 109k
0 votes

How could I estimate a transition probability matrix that varies over time?

You can use a multinomial regression model (using previous state and time as independent variables), and you can use any typical regression modelling techniques such as regularization, feature ...
  • 5,354
0 votes

What is the difference between z.ratio and t.ratio in the pairwise comparison output using emmeans function?

The test statistic has the same form in either case, a difference divided by its standard error, but the comparison is either against a t distribution with the specified number of degrees of freedom ...
  • 77.4k
0 votes

Correct calculation of repeated cross-validation classification metrics

The answer above is great. Here is one more thing to keep in mind: ConfusionMatrix() defaults to normalizing (i.e., norm =) the confusion matrix to the proportion ...
1 vote

Why is standard error of clustered observations not under-estimated?

You've drawn from two different populations, so your comparison is not valid. The question you want to ask is: Given a clustered population, what is the impact of ignoring clustering? Let's say we ...
  • 511
1 vote

How to measure/rank "variable importance" when using CART? (specifically using {rpart} from R)

The caret package and the rpart package each have ways to list the variables and rank their importance, but generate different results from each other when calculating variable importance. ...
0 votes

Does R-squared help assess statistical significance?

All else equal, the higher the $R^2$, the higher the $F$-stat and the lower the p-value. That "all else equal" is crucial, however. If you increase the $R^2$ by throwing many parameters at ...
  • 46.4k
0 votes

Best analysis for site selection with paired data

With your data, the isSingular warning simply means that the data don't provide enough information to distinguish the variance among random intercepts from a value ...
  • 77.4k
1 vote

Comparing emmeans values multinom model

Is there a way to deal with the rather large difference in group size? Statistically the smaller group size caused a larger confidence interval which made the effect less significant. You have less ...
  • 7,643
1 vote

Comparing emmeans values multinom model

The emmeans package does not require equal sample sizes, so to that extent you are worrying too much. It uses the variance-covariance matrix of coefficient ...
  • 77.4k
1 vote

How to correctly set up my mixed-effect model?

As @shawn-hemelstrand commented, I am pretty surprised that this code converged for you. nlmer::lme() will sometimes allow users to fit models that they do not have ...
  • 857
1 vote

Evaluating goodness-of-fit for GARCH models in R with QQ-plots (rugarch package)

To assess the distributional assumption of a GARCH model, you can look at the probability integral transform (PIT) of the standardized residuals. It can be obtained by ...
3 votes
Accepted

pROC package - sensitivity and specificity calculations

As @Dave indicated in the comments above, pROC attempts to detect if the positive group displays higher or lower values of the predictor than the control group. This can be controlled with the ...
  • 3,184
1 vote

R glm for censored data

Possibly you might figure out some distribution and apply some censurized estimation method. But, in this case, a single regressor (the groups), it might be easier to perform a permutation test.
2 votes
Accepted

R glm for censored data

The blood biomarker concentration measurements are censored because of the upper detection limit (at 2,500 judging from the plots). You can use ordinal regression (aka proportional odds regression) to ...
  • 7,643
1 vote
Accepted

Why isn't the residual standard error referred to as RMSE?

Referring to “the” MSE is probably a mistake, since there are reasonable arguments for multiple calculations (an $n$ denominator and and $n−p$ denominator both make sense). I would want to define ...
  • 46.4k
4 votes
Accepted

What interpretation do REML/fREML values provide in generalized additive models (GAMs)?

All the fitting methods in gam()/bam() return some form of smoothness selection score: GCV UBRE (AIC) GACV REML score ML score ....
0 votes

What is the difference between these two mixed model specifications?

First off, I suggest reading Bates et al., 2015 to get an idea of what your syntax is doing in both models. I cite it below, but there is a specific page dedicated to this if you have questions about ...
0 votes

What is the difference between these two mixed model specifications?

There is another, more general, question on StackExchange: R's lmer cheat sheet. The resources linked there might be able to address my question. In particular, it seems that the form (1 + ...
1 vote
Accepted

How to use slopes in PCA?

The problem is at least partially mitigated if you standardize before computing the slopes. ...
  • 857
0 votes

mvabund package can't handle offsets?

You may need to log transform the input variable (Number.of.samples) you're using for your offset variable, to match the log link function of the negative binomial. Here is a link to an mvabund ...
3 votes

Can you impute (predict) missing continuous data using categorical data as the predictor?

There's no reason not to mix different types of data for multiple imputation (continuous, categorical, ordinal etc.). It's just a matter of whether the particular software you use can support it (e.g. ...
  • 27.1k
0 votes

How get survival function estimates from Aalen's additive regression?

Klein and Moeschberger (Second Edition) devote Chapter 10 to additive models. Practical Notes to Section 10.2 discuss this matter. The estimates of the baseline hazard rate are not constrained to be ...
  • 77.4k
1 vote
Accepted

Identifying root cause of very poor Random Forest model

(In the comments, I see you think it solved, so this is more general advice.) To identify the root cause of a poor model, you should start by getting a baseline model to compare against. As you are ...
  • 2,079
1 vote

Comparison of the performances of Regression Models and ANN models

Out-of-sample testing is the standard way to do this. Train your model on most but not all of your data Even better might be to have multiple out-of-sample groups (something like cross validation). ...
  • 46.4k
1 vote
Accepted

Interpreting ordinal regression output in R polr()

I find it easier to think about this model using the latent-variable representation. For simplicity, let's assume that your model has only one independent variable (GPA), and that the dependent ...
  • 1,293
1 vote

Interpreting shape and rate parameters from a weibull model of mortality hazard in BaSTA

With so many parameterizations of Weibull models in survival analysis, you first need to identify the parameterization that has been used. According to the BaSTA ...
  • 77.4k
2 votes

Confidence interval in logistic regression when probability of success is 1

This just in... Try using the logistf package instead of glm: ...
  • 17.7k
1 vote
Accepted

Regression analysis with constant dependent variable

Algebraically, it's quite straightforward to show why this is the case, but here's a visual explanation. This is a scatterplot of your data: You want to fit the model $y_i = \alpha + \beta x_i + \...
  • 1,293
0 votes

Interaction variables with percentage/share

The magnitude of a regression coefficient is related to the measurement scale of the associated continuous predictor. A change of 1 unit in outcome per millimeter change in a predictor is equivalent ...
  • 77.4k
0 votes

Interpreting regression and variable set-up

I suspect that your observation: When I look at the coefficients it seems that the inti,t is a lot more significant than the interaction which is likely due to the imported flows (in MWh) being quite ...
  • 77.4k
1 vote

How to code survival data so that sarting survival is below 1

Don't. As @SextusEmpiricus said in a comment, "The inclusion of the people that didn't receive rehabilitation into the analysis (with a time t=0) is wrong, because this is interpreted as those ...
  • 77.4k
0 votes

Interpreting coefficients of beta regression

You interpret a logit-link beta regression output in a same way that you would interpret a logit-link logistic regression. We are modelling the expectation of the Beta-distributed Random Variable $Y$, ...
  • 511
0 votes

Multiple vs Single Predictor Variables for GLMM Pairwise Comparisons

I suggest that you use one model with all the predictors. Here are two good reasons: If you have a model with one predictor, you only explain the effects of that one predictor, and any unexplained ...
  • 17.7k
0 votes

Testing the interaction of B:C on a glm using the analysis of deviance in R

You have to be careful when you say "anova() function," as even in R that can have different meanings depending on the type of model and package. For your ...
  • 77.4k
1 vote
Accepted

What is the difference between z-value and the Wald statistic in the summary function of the Cox Proportional Hazards model of the “survival” package?

Both are correct, if there's just a single coefficient involved. "[D]ividing the squared coefficient estimate by its estimated variance" gives a statistic evaluated against a chi-square ...
  • 77.4k
1 vote
Accepted

Effects of 'Select = TRUE' on covariates in GAM

You are wrong to assume the select = TRUE will necessarily result in lower complexity smooths. The tests in the output of ...
1 vote

I have a moderate to high correlation and a p-value that is non-significant. Do I still reject the whole hypothesis?

When you do a significance test, you reject, or you fail to reject, the null hypothesis based on the p-value from the significance test. Your p-value is not significant, therefore you fail to reject ...
  • 15.4k
4 votes

I have a moderate to high correlation and a p-value that is non-significant. Do I still reject the whole hypothesis?

I'm sure this question is covered elsewhere on this site. But basically, for Pearson correlation, there is a relationship between sample size, the correlation coefficient, and the resultant p-value. ...
1 vote

DHARMa outlier test is significant, what are my next steps?

It doesn't look too bad to me from the qqplot either. But you could also have a look on the histogram provided by testDispersion(ModelNB, type = "DHARMa") ...
  • 11
1 vote

Unconventional odds ratio and 95% CI

There are no numbers would immediately be obviously wrong. The only possibility would be numbers that are mathematically impossible, such as odds ratios that are negative. In general, regression ...
0 votes

How to perform Kaplan Meier of Relapse/Disease Free Survival?

From the National Cancer Institute's definition of "relapse-free survival": In cancer, the length of time after primary treatment for a cancer ends that the patient survives without any ...
  • 77.4k
0 votes
Accepted

create and sample from a PDF using real data

If your data has no bounds (and you know that), then one way is the following: ...
  • 3,206
1 vote
Accepted

Rendering the decision tree as a step function

Extract the relevant information from linear_tree$splits[,"index"], which gives you the x values at which your tree ...
1 vote
Accepted

Why is the confidence interval for difference in two proportions inconsistent with the p-value for this difference in R prop.test()?

The difference is in how the standard error is computed. This can be done based on a pooled estimate of the variance and the assumption of equal probabilities (which makes sense if the null hypothesis ...
0 votes

Statistically support a conclusion of time series

Since you didn't get any answer yet, let me give you a short one. First, there is no single solution. There are many different possible approaches. Choosing between them would boil down to the details ...
  • 127k
1 vote

Warnings for confint() in lme4

Your problem is already here, which is a well-documented problem in mixed modeling with lme4: ...

Top 50 recent answers are included