# Tag Info

## Hot answers tagged regression

13

(Edited taking into account comments below. Thanks to @BenBolker & @WeiwenNg for helpful input.) Fit a fractional logistic regression to the data. It is well suited to percentage data that is bounded between 0 and 100% and is well-justified theoretically in many areas of biology. Note that you might have to divide all values by 100 to fit it, since ...

8

This isn't a different answer from @mkt but a graph won't fit into a comment. I fit a logistic curve in Stata (after logging the predictor) and get this graph An equation is 100 invlogit(-4.192654 + 1.880951 log10(Copies)) EDIT: Essentially just an indication of technique. Separating the two viruses is, as mentioned elsewhere, a next step.

5

In a linear regression model, the joint sampling distribution of the model parameters is described in this post and this one. Specifically, $$\hat{\beta}\;|\;X\sim \mathrm{N}\left(\beta, \sigma^{2}(X^TX)^{-1}\right)$$ where $X$ is the design matrix. In a simple linear regression with only one predictor and an intercept, the design matrix has dimensions $N\... 5 Yes, it's completely possible to get large coefficients and small$R^2$values. Consider that the coefficient values depend on units, while$R^2$does not. So if a model with length as a predictor switches from using kilometres to millimetres, the coefficients will increase by a factor of$10^6$without changing the$R^2$. Yes, your interpretation is ... 4 You could also treat your outcome as an ordinal variable and fit a mixed-effects model for this ordinal response. Ordinal mixed models are available in the GLMMadaptive package; for an example, check the vignette Mixed Models for Ordinal Data. Alternatively, and if you do not have any missing data in your outcome (or the missing data that you may have can ... 4 There are two things to consider here. First, the p value reported for an individual coefficient in a standard linear regression is based on a t-test. As that test uses an estimate of the standard error taken from the data, the reliability of the standard error estimate depends on both the number of observations and the number of parameters that are ... 4 It's true that categorizing continuous variables can lead to some problems, but it can also help approximate a complex model more easily. For the same number of degrees of freedom, though, it might be preferable to fit a flexible linear model (e.g., a spline or polynomial model). That said, there is some (older) literature that justifies splitting into ... 3 There are two pretty plausible explanation to my mind (and both might play a role at the same time): Statistical significance is a random variable, sampling a different set of observations/subsetting differently/changing something about a model will lead to a different realization for this random variable. This is very often the explanation for "I changed ... 3 Impossible that one predictive model is better than two? Rather than getting into the weeds on your specific models, let's just step back and view this question in a more general setting. If we consider an arbitrary series of observable values, then it is possible that a model could give a perfect prediction of those values, and it is possible that a model ... 3 You are correct: gender would be an explanatory variable (or predictor/independent variable) in this case. However, you should be aware that the paper you are presumably basing this on has received an extraordinary amount of criticism for poor analysis. For e.g. https://www.washingtonpost.com/news/monkey-cage/wp/2014/06/05/hurricanes-vs-himmicanes/?... 2 Be cautious - most analysts do not use the bootstrap to get confidence intervals for variable importance measures, but when they do they are usually disappointed. The data, unless massive, do not contain sufficient information to tell you reliably which elements of the data are predictive, and do not have sufficient information for telling you how important ... 2 Your hypothesis seem to be getting at effect moderation. Though I can't specifically speak to any of those analyses, I can tell you how to go about computing the sample size for a linear regression. Here are the steps... a) Write down the regression model. This will inform which effects can be assessed. So, for instance, the simplest linear model would ... 2 You want to predict a binary (0/1) variable, definitely start out with logistic regression. ANOVA is really a variant on usual linear regression (for continuous response), and uses some assumptions that are definite not true for binary response, like constant error variance. As for the numbered points, this is a very broad question ... but note that ... 2 If you want a crude representation with a reasonable mean-variance relationship, a quasibinomial model would probably work OK: in R, glm(cbind(score,10-score) ~ ..., family=quasibinomial, ...) cbind(score,10-score) specifies to treat the response as a number of "successes" out of a maximum 10. Specifically, this means you'd be fitting a model with a ... 2 Here are the 4PL (4 parameter logistic) fits, both constrained and unconstrained, with the equation as per C.A. Holstein, M. Griffin, J. Hong, P.D. Sampson, “Statistical Method for Determining and Comparing Limits of Detection of Bioassays”, Anal. Chem. 87 (2015) 9795-9801. The 4PL equation is shown in both figures and the parameter meanings are as follows: ... 2 I extracted the data from your scatterplot, and my equation search turned up a 3-parameter logistic type equation as a good candidate: "y = a / (1.0 + b * exp(-1.0 * c * x))", where "x" is the log base 10 per your plot. The fitted parameters were a = 9.0005947126706630E+01, b = 1.2831794858584102E+07, and c = 6.6483431489473155E+00 for my extracted data, a ... 2 If you have a complex model and you train it sufficiently, it can memorize the training data, even reaching an error of$0$(this is called overfitting). The problem is that this doesn't necessarily mean that your model is any good because it might not be able to generalize well on unseen data. Because of this, if you select your model just based on ... 1 Let us assume: y_true = [1,2,3,4,5] y_pred = [1,2,3,4,5] y_pred2 = [3,4,5,6,7] y_pred3 = [2,6,9,10,15] where, y_pred, y_pred2 and y_pred3 are predictions from 3 different models. If you calculate pearson correlation for them the answers would be: corr_ypred = 1 corr_ypred2 = 1 corr_ypred3 = 0.9827 where, corr_ypred, corr_ypred2 ... 1 Since I had to open my big mouth about Heaviside, here's the results. I set the transition point to log10(viruscopies) = 2.5 . Then I calculated the standard deviations of the two halves of the data set -- that is, the Heaviside is assuming the data on either side has all derivatives = 0 . RH side std dev = 4.76 LH side std dev = 7.72 Since it turns ... 1 Try sigmoid function. There are many formulations of this shape including a logistic curve. Hyperbolic tangent is another popular choice. Given the plots, I can't rule out a simple step function either. I'm afraid you will not be able to differentiate between a step function and any number of sigmoid specifications. You don't have any observations where ... 1 First, I recommend using substantive knowledge to do some of this. Think about what all those variables are. Think about how reliable and valid they are. Think about whether they will be easy or hard to collect. Think about which ones will generate missing data. Etc. Then I recommend partial least squares regression (PLSR). PLSR is a date reduction method ... 1 Here's a perspective: the two model approach is more constrained, hence is always going to result in an inferior model. Consider the 2m (two-model) model - it looks like: $$f_{2m}(\mathbf{x}) = 1.5 (\mathbf{c_1} \cdot \mathbf{x}^T) + 1.0 (\mathbf{c_2} \cdot \mathbf{x}^T)$$ where$\mathbf{c}_i$were trained in separate models. We can rewrite this as a 1m (... 1 Though I'm not sure, Wikipedia says that this is how AIC is used in practice. I think it depends on if you're interested in doing inference, or if you want to do prediction. 1 In simple linear regression, we have$\hat{y_i}=\hat{\beta}x_i+\hat{\alpha}$, where $$\hat{\beta}={{\sum (x_i-\bar{x})(y_i-\bar{y})}\over {\sum(x_i-\bar{x})^2}},\ \ \ \hat{\alpha}=\bar{y}-\hat{\beta}\bar{x}\rightarrow \hat{y}_i-\bar{y}=\hat{\beta}(x_i-\bar{x})$$ Substituting this into the formula of coefficient of determination:$\$\begin{align}R^2&=\...

1

I'm ignoring external context about this paper and analysis for the purposes of this answer. 1. Does this Poisson regression model have a good fit for these data? We have no way to judge that from the output you have presented. 2. How can I interpret the coefficients? I don't know which genders 0 and 1 represent. But the output means that Gender_MF =...

1

I looked at the data at kaggle. They have much missing, so that should be tackled somehow, maybe multiple imputation, but I will not touch that. A simple plot is Which shows that there is indeed higher (global) sales when the critic score is high, but the effect really starts at somewhat high scores. What you propose seems to be to cut in two groups ...

1

There's no clear bivariate relationship that's obvious in your plots. A next step you can consider is constructing a multiple regression model that attempts to predict injury_rate using ALL the predictors you are hypothesizing contribute to it, simultaneously. You can then investigate this more complex model to see if the variables jointly explain/predict ...

1

This problem is not conceptually different from a standard multi-category 1-way ANOVA, except that it involves logistic regression instead of (the equivalent of) standard linear regression. You thus have two issues to address: whether there are any significant differences at all among the 10 cancer types with respect to the probability of seizures, and if so ...

1

Yes, a multiple regression probably would be appropriate here. You would need to specify the interactions in the model for this to work, so it's good that you have specific hypotheses/expectations about which variables interact. I said probably in the previous point because it depends on the structure of the dependencies you are interested in. It is possible ...

1

You can get turn the approximate exponential increase into a linear increase by taking log of the DV. Then you can a) model a linear fit and graphically see what happens at the thresholds, b) Model a spline fit with predetermined knots and see what happens at the knots and c) Model a spline fit without predetermined knots and see if the knots show up where ...

Only top voted, non community-wiki answers of a minimum length are eligible