I am using SAS 9.4 .  My aim is to find out whether my residual is normal or not, so i type this:  proc univariate data= residual normal; var rstd; qqplot rstd/ norml(mu=est sigma=est); run;   In my output the qqplot is clearly a straight while 4 pavlue of statistic for the normality is less then 5%.  How can i interpret this?
104231
I have read enough threads on QQplots here to understand that a QQplot can be more informative than other normality tests. However, I am inexperienced with interpreting QQplots. I googled a lot; I found a lot of graphs of non-normal QQplots, but no clear rules on how to interpret them, other than what it seems to be comparison with know distributions plus "gut feeling".   I would like to know if you have (or you know of) any rule of thumb to help you decide for non-normality.  This question came up when I saw these two graphs:    I understand that the decision of non-normality depends on the data and what I want to do with them; however, my question is: generally, when do the observed departures from the straight line constitute enough evidence to make unreasonable the approximation of normality?  For what it's worth, the Shapiro-Wilk test failed to reject the hypothesis of non-normality in both cases.
33700
There are several threads on this site discussing  to determine if the OLS residuals are  normally distributed. Another way to evaluate the normality of the residuals with R code is provided in this excellent . This is another  on the practical difference between standardized and observed residuals.  But let's say the residuals are definitely not normally distributed, like in this . Here we have several thousand observations and clearly we must reject the normally-distributed-residuals assumption. One way to address the problem is to employ some form of robust estimator as explained in the answer. However I am not limited to OLS and in facts I would like to understand the benefits of other glm or non-linear methodologies.  What is the most efficient way to model data violating the OLS normality of residuals assumption? Or at least what should be the first step to develop a sound regression analysis methodology?
82115
I am trying to fit a model to predict housing prices. My residual plots look like the following:  Should I be concerned about the large hump for the higher quantiles? Would a transformation on the response variable help?
52262
I have fitted a binomial regression in R using glm.nb from the MASS package.  I have two questions and would be very thankful if you could answer any of them:  1a) Can I use the Anova (type II, car package) to analyse which explanatory variables are significant? Or should I use the summary() function?  However, the summary uses a z-test which requires normal distribution if i am not mistaken. When looking at examples in books and websites, mostly summary has been used. I get completely different outcomes for Anova test and summary. Based on visualisation of the data I feel that Anova is more accurate. (i only get different outcomes when I have included an interaction).  1b) When using the Anova, both an F-test, chi-square test and anova (type 1) give different (but pretty similar) results - is there any of these tests that is preferred for a negative binomial regression? Or is there any way to find out which test represents the most likely results?   2) When looking at the diagnostic plots, my qq-plot looks kinda off. I am wondering if this is fine - since the negative binomial is different from the normal distribution? Or should the residuals still be normally distributed?
118775
Im analysing count data (number of clinic visits) when I test for poisson distribution using 1 sample KS test in spss the sig is &lt;0.05( meaning it doesnt follow poisson distribution ) it does not follow normal distribution either,  no values of zero, the values are either 1,2,3,or 5, what can I do
112107
This wikipedia  lists a number of techniques to detect OLS residuals heteroscedasticity. I would like to learn which hands-on technique is more efficient in detecting regions affected by heteroscedasticity.  For example, here the central region in the OLS 'Residuals vs Fitted' plot seen to have higher variance than the sides of the plot (I am not entirely sure in facts, but let's assume it's the case for the sake of the question). To confirm, looking at the error labels in the QQ plot we can see that they match the error labels in the center of the Residuals plot.  But how can we quantify the residuals region that has significantly higher variance?
16354
I have a large dataset (500000 data, V1 column include all the data).  x &lt;- read.csv("mydata.csv", header=F) hist(x)   Which gives:    Looking at the data, I believe it is not a normal distribution. As a further check, I constructed a qqplot:  x_norm &lt;- (x$V1 - mean(x$V1))/sd(x$V1) qqnorm(x_norm); abline(0, 1)   which gave:    To check the goodness of fit of x$V1 (rawdata) to a normal distribution, I used:  rnorm &lt;- rnorm(500000, mean(x$V1), sd(x$V1)) cc &lt;- cbind(rnorm, x$V1) g &lt;- goodfit(cc, method="MinChisq") summary(g)           Goodness-of-fit test for poisson distribution               X^2 df      P(&gt; X^2) Pearson 914.5227 17 1.679266e-183 Warning message: In summary.goodfit(g) : Chi-squared approximation may be incorrect   With plot(g) giving:    Does this seem correct? Can I confidently conclude my dataset X$V1 is or is not a normal distribution?  Based on the above analysis, what other distribution should I test?
47903
I would like to get a p-value and an effect size of an independent categorical variable (with several levels) -- that is "overall" and not for each level separately, as is the normal output from lme4 in R. It is just like the thing people report when running an ANOVA.  How can I get this?
78874
I am trying to run the following model:         I(week^2):mutation_status +         (week + I(week^2) | subject_id) ,          data = sim_dat)  This is the output I get from this model. The correlation between week and I(week)^2 is rather high (-0.95) and I was curious to know how I can change my data simulation code to lower that value. I am also having issues with convergence and would love to get thoughts on how to avoid issues regarding convergence. Thank you! Linear mixed model fit by REML. t-tests use Satterthwaite's method [lmerModLmerTest]  Formula: fetal_weight ~ week + mutation_status + week:mutation_status + I(week^2) +  I(week^2):mutation_status + (week + I(week^2) | subject_id) Data: sim_dat  REML criterion at convergence: 114  Scaled residuals:      Min      1Q  Median      3Q     Max  -1.9343 -0.3980 -0.0075  0.4168  1.9928   Random effects:  Groups     Name        Variance  Std.Dev. Corr         subject_id (Intercept)   1.51524  1.2309                          week         61.01832  7.8114   0.16                   I(week^2)   496.20236 22.2756  -0.19 -0.95  Residual                 0.05892  0.2427              Number of obs: 100, groups:  subject_id, 20  Fixed effects:                            Estimate Std. Error       df t value       Pr(&gt;|t|)     (Intercept)                  3.1331     0.4226  17.9961   7.413 0.000000713699 *** week                        -1.2465     3.5210  18.0053  -0.354          0.727     mutation_statusY             0.5061     0.5977  17.9961   0.847          0.408     I(week^2)                   34.5706    10.8146  18.0084   3.197          0.005 **  week:mutation_statusY       -1.0697     4.9795  18.0053  -0.215          0.832     mutation_statusY:I(week^2) 202.5521    15.2942  18.0084  13.244 0.000000000101 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  Correlation of Fixed Effects:             (Intr) week   mttn_Y I(w^2) wk:m_Y week        -0.160                             muttn_sttsY -0.707  0.113                      I(week^2)    0.145 -0.966 -0.103               wk:mttn_stY  0.113 -0.707 -0.160  0.683        mtt_Y:I(^2) -0.103  0.683  0.145 -0.707 -0.966  Code for data simulation: set.seed(123)  # set the seed J &lt;- 20  # number of individuals (clusters) cs &lt;- 5  # number of time points (cluster size) gam &lt;- c(0, 0.75, 1.34)  # fixed effects G &lt;- matrix(c(1.75, 0, 0,               0, 0.0125, 0,               0,0,0.0625),              nrow = 3)  # random effect variances (G-matrix) sigma2 &lt;- 0.08  mutation_status &lt;- rep(0:1, each = 5) mutation_status &lt;- rep(mutation_status, times = 10)  X &lt;- cbind(1, seq_len(cs),             (seq_len(cs))^2)  # for each individual X &lt;- X[rep(seq_len(cs), J), ]  X &lt;- X[rep(seq_len(cs), J), ]  X[,2] &lt;- X[,2]*0.05 X[,3] &lt;- X[,3]*0.05  # repeat each row cs times pid &lt;- seq_len(J)  # individual id pid &lt;- rep(pid, each = cs)   # Generate person-level (lv-2) random effects uj &lt;- lmf::rmnorm(J, mean = rep(0, 2), varcov = G)  # Generate repeated-measure-level (lv-1) error term eij &lt;- rnorm(J * cs, sd = sqrt(sigma2))  # Compute beta_j's betaj &lt;- matrix(gam, nrow = J, ncol = 3, byrow = TRUE) + uj  # Compute outcome: y &lt;- rowSums(X * betaj[pid, ]) + eij + mutation_status*X[ , 3]*10 + 3  # Form a data frame sim_dat &lt;- tibble(y, time = X[ , 2], pid, mutation_status) sim_dat &lt;- sim_dat[,c(3,2,4,1)] colnames(sim_dat) &lt;- c(&quot;subject_id&quot;, &quot;week&quot;, &quot;mutation_status&quot;, &quot;fetal_weight&quot;) sim_dat$week_2 &lt;-sim_dat$week*5 + 15  sim_dat$mutation_status &lt;- as.factor(ifelse(sim_dat$mutation_status == 0, &quot;N&quot;, &quot;Y&quot;)) sim_dat$subject_id &lt;- as.factor(sim_dat$subject_id ) #Model Building
119594
Suppose you are given a $95 \%$ CI $(1,6)$ based on the normal distribution. Is there any easy way to find $\mu$ and $\sigma$? What if it came from a gamma distribution? Can we do this in R?
24838
How to interpret the Null and Residual Deviance in GLM in R? Like, we say that smaller AIC is better. Is there any similar and quick interpretation for the deviances also?  Null deviance: 1146.1  on 1077  degrees of freedom Residual deviance:  4589.4  on 1099  degrees of freedom AIC: 11089
44090
I have data from 3 groups of algae biomass ($A$, $B$, $C$) which contain unequal sample sizes ($n_A=15$, $n_B=13$, $n_C=12$) and I would like compare if these groups are from the same population.  One-way ANOVA would definitely be the way to go, however upon conducting normality tests on my data, heteroskedascity seems to the main issue. My raw data, without any transformation, produced a  ratio of variances ($F_{\max} = 19.1$) which is very much higher than the critical value ($F_{\rm crit} = 4.16$) and therefore I cannot perform one-way ANOVA.   I also tried transformation to normalise my data. Even after trials of various transformations (log, square root, square), the lowest $F_{\max}$ produced after transformation with a $\log_{10}$ transformation was $7.16$, which was still higher compared to $F_{\rm crit}$.  Can anyone here advise me on where to go from here? I can't think of other methods of transformation to normalise by data. Are there any alternatives to a one-way ANOVA?  P.S.: my raw data are below:   A: 0.178 0.195 0.225 0.294 0.315 0.341 0.36  0.363 0.371 0.398 0.407 0.409 0.432     0.494 0.719 B: 0.11  0.111 0.204 0.416 0.417 0.441 0.492 0.965 1.113 1.19  1.233 1.505 1.897 C: 0.106 0.114 0.143 0.435 0.448 0.51  0.576 0.588 0.608 0.64  0.658 0.788 0.958
104901
I have the following result from running glm function.   How can I interpret the following values:   Null deviance Residual deviance AIC   Do they have something to do with the goodness of fit? Can I calculate some goodness of fit measure from these result such as R-square or any other measure?  Call: glm(formula = tmpData$Y ~ tmpData$X1 + tmpData$X2 + tmpData$X3 +      as.numeric(tmpData$X4) + tmpData$X5 + tmpData$X6 + tmpData$X7)  Deviance Residuals:       Min        1Q    Median        3Q       Max   -0.52628  -0.24781  -0.02916   0.25581   0.48509    Coefficients:                      Estimate Std. Error  t value Pr(&gt;|t|)     (Intercept         -1.305e-01  1.391e-01   -0.938   0.3482     tmpData$X1         -9.999e-01  1.059e-03 -944.580   &lt;2e-16 *** tmpData$X2         -1.001e+00  1.104e-03 -906.787   &lt;2e-16 *** tmpData$X3         -5.500e-03  3.220e-03   -1.708   0.0877 .   tmpData$X4         -1.825e-05  2.716e-05   -0.672   0.5017     tmpData$X5          1.000e+00  5.904e-03  169.423   &lt;2e-16 *** tmpData$X6          1.002e+00  1.452e-03  690.211   &lt;2e-16 *** tmpData$X7          6.128e-04  3.035e-04    2.019   0.0436 *   --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1   (Dispersion parameter for gaussian family taken to be 0.08496843)      Null deviance: 109217.71  on 3006  degrees of freedom Residual deviance:    254.82  on 2999  degrees of freedom   (4970 observations deleted due to missingness) AIC: 1129.8  Number of Fisher Scoring iterations: 2
41358
I realize that this is a very basic question, but I can't find an answer anywhere. I'm computing regression coefficients using either the normal equations or QR decomposition.  How can I compute standard errors for each coefficient?  I usually think of standard errors as being computed as: $SE_\bar{x}\ = \frac{\sigma_{x}}{\sqrt{n}}$ What is $\sigma_{x}$ for each coefficient?  What is the most efficient way to compute this in the context of OLS?
21823
I've got a very small coefficient (-0.04) and R-squared (0.028) but a significant P value (&lt;0.0001). My question is:   Is my result still meaningful? How to interpret it?   The result is from a linear regression model in a big database in R.  The independent variable (B) has more than 200 values, whereas the dependent variable (A) has 13 values.   The potential correlation is below:   So, I ran a linear regression model between A and B and the result is:  &gt;mod1&lt;-lm(A~B)          Call:         lm(formula = A ~ B)           Residuals:              Min      1Q  Median      3Q     Max           -63.174 -11.816  -1.651  10.184 118.001            Coefficients:                        Estimate Std. Error t value Pr(&gt;|t|)              (Intercept) 132.274547   0.303723 435.511  &lt; 2e-16 ***          B            -0.036675   0.009052  -4.052 5.13e-05 ***          ---         Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1          Residual standard error: 18.52 on 8093 degrees of freedom            (123 observations deleted due to missingness)         Multiple R-squared:  0.002024,  Adjusted R-squared:  0.001901          F-statistic: 16.42 on 1 and 8093 DF,  p-value: 5.134e-05   As you can see, the coefficient of B is only -0.03 and adjusted R squared is only 0.1% but with a p value &lt;0.0001. Is my result reasonable and countable? Surely, my database is larger (8000 records) and even a very small effect size will show a significant P value. But how would I interpret this?
6267
I'm trying to replicate ARIMA (1,0,1)(1,0,1) equation in excel as a formula but I am not able to understand the interpretation of white noise residual e(t) or u(t).If could help me understand the interpretation and how to derive it from raw data it'll be really great.  Thanks
82748
I know that standardized Pearson Residuals are obtained in a traditional probabilistic way: $$ r_i = \frac{y_i-\hat{\pi}_i}{\sqrt{\hat{\pi}_i(1-\hat{\pi}_i)}}$$ and Deviance Residuals are obtained through a more statistical way (the contribution of each point to the likelihood): $$ d_i = s_i \sqrt{-2[y_i \log \hat{\pi_i} + (1 - y_i)\log(1-\hat{\pi}_i)]} $$ where $s_i$ = 1 if $y_i$ = 1 and $s_i$ = -1 if $y_i$ = 0. Can you explain to me, intuitively, how to interpret the formula for deviance residuals? Moreover, if I want to choose one, which one is more suitable and why? BTW, some references claim that we derive the deviance residuals based on the term $$-\frac{1}{2}{r_i}^2$$ where $r_i$ is mentioned above.