DWin
  • Member for 11 years, 1 month
  • Last seen this week
  • Alameda, CA
How to interpret coefficients in a Poisson regression?
70 votes

The exponentiated numberofdrugs coefficient is the multiplicative term to use for the goal of calculating the estimated healthvalue when numberofdrugs increases by 1 unit. In the case of categorical (...

View answer
Understanding Kolmogorov-Smirnov test in R
25 votes

The KS test is premised on testing the "sameness" of two independent samples from a continuous distribution (as the help page states). If that is the case then the probability of ties should be ...

View answer
How to calculate goodness of fit in glm (R)
18 votes

The default error family for a glm model in (the language) R is Gaussian, so with the code submitted you are getting ordinary linear regression where $R^2$ is a widely accepted measure of "goodness of ...

View answer
How should you handle cell values equal to zero in a contingency table?
17 votes

Zeros in tables are sometimes classified as structural, i.e.zero by design or by definition, or as random, i.e. a possible value that was observed. In the case of a study where no instances were ...

View answer
R linear regression categorical variable "hidden" value
Accepted answer
14 votes

Q: " ... how do I interpret the x2 value "High"? For example, what effect does "High" x2s have on the response variable in the example given here?? A: You have no doubt noticed that there is no ...

View answer
When combining p-values, why not just averaging?
11 votes

So if you did three studies of similar sizes and got a p-value of 0.05 on all three occasions, your intuition is that the "true value" should be 0.05? My intuition is different. Multiple similar ...

View answer
How to specify a lognormal distribution in the glm family argument in R?
11 votes

Regarding fitting the exponential model with glm: When using the glm function with family=Gamma one needs to also use the supporting facilities of summary.glm in order to fix the dispersion parameter ...

View answer
Splitting a numeric column for a dataframe
Accepted answer
10 votes

df_split<- strsplit(as.character(df$position), split=":") df <- transform(df, seq_name= sapply(df_split, "[[", 1),pos2= sapply(df_split, "[[", 2)) > > df name position pos seq_name ...

View answer
Is there a difference between 'controlling for' and 'ignoring' other variables in multiple regression?
9 votes

They are not ignored. If they were 'ignored' they would not be in the model. The estimate of the explanatory variable of interest is conditional on the other variables. The estimate is formed "in the ...

View answer
Time dependent coefficients in R - how to do it?
8 votes

@mpiktas came close in offering a feasible model, however the term that needs to be used for the quadratic in time=t would be I(t^2)) . This is so because in R the formula interpretation of "^" ...

View answer
How to visualize a significant interaction between two linear predictors using the rms package?
Accepted answer
7 votes

The rms package allows you to model interactions between continuous variables very flexibly. This is a demonstration of modeling crossed regression splines with that data: (m <- cph(Surv(time, ...

View answer
Efficient way to populate matrix in R?
Accepted answer
7 votes

Generally tables are handled as matrices or arrays and matrix indexing allows two column arguments as (i,j)-indexing (and if the object being indexed has higher dimensions then matrices with more ...

View answer
How does bootstrapping in R actually work?
7 votes

You should focus on the function that is passed to boot as the "statistic" parameter and notice how it is constructed. f <- function(data, i) { require(pscl) m <- zeroinfl(count ~ child + ...

View answer
Importance of variables in logistic regression
7 votes

The answer to your last question is a flat NO. The magnitude of coefficients are in no way a measure of importance. The lasso can be used for logistic regression. You need to study the area more ...

View answer
How to perform a Wilcoxon signed rank test for survival data in R?
Accepted answer
7 votes

(You should probably cite the source for your naming conventions and explain in more detail why this question is being posed. If this a case of trying to match the documentation for SAS or SPSS we ...

View answer
Singular information matrix error in lrm.fit in R
Accepted answer
7 votes

Creating dummy variables should not be necessary. You should just use factors when modeling in R. admityear <- factor(admityear) m4 <- lrm(Outcome ~ relGPA + mcAvgGPA + Interview_Z + ...

View answer
Threshold models and flu epidemic recognition
Accepted answer
6 votes

The CDC uses the epidemic threshold of 1.645 standard deviations above the baseline for that time of year. The definition may have multiple sorts of detection or mortality endpoints. (The one you ...

View answer
R t.test ..... NOT significant anymore
6 votes

The two-group t-test balances (by computing their ratios) two aspects of the distributions of the values, one: the difference in the means, which your "disturbance" did increase somewhat, and two: the ...

View answer
A critical proof or counterexample regarding independence
6 votes

It seems likely that you could fairly easily construct a counter-example by assigning the negative roots of $Y^2$ to $Y$ for $X\leq1$ and to the positive roots for $X > 1$. Y <- rnorm(1000)^2 X ...

View answer
Filling NAs in a dataset with column medians in R
6 votes

(Some moderator must have a warped sense of what is R and what is statistics. This is a coding question if I ever saw one.) Since the columns are of necessity "character" the values will be "character"...

View answer
What is the best way to visualize a single numeric variable as a heatmap?
Accepted answer
6 votes

Use density and fields::colorbar.plot require(fields) plot(1:10, rep(1,10), ylim=c(0,10)) colorbar.plot( 2, 4, 800*density(rgamma(100, shape=2))$y) colorbar.plot( 2, 5, 800*density(rexp(100))$y) ...

View answer
Mean of means by a factor versus global mean
6 votes

Only when the counts in all groups are the same will the mean of means equal the global mean,

View answer
Plotting binomial proportions on a box & whiskers plot using R
Accepted answer
6 votes

This really does look to be more appropriate to an [r] tagged question in SO but there seems to be a surprisingly wide degree of tolerance for such questions in CV, so here goes. The answer also ...

View answer
How to calculate the rowMeans with some single rows in data?
Accepted answer
6 votes

You can prevent the loss of the dimension attribute when using "[" with drop=FALSE: tapply(colnames(myMA), c(1,1,1,2,2,2,3,3,4,4), list) myMAmean <- sapply(myList, function(x) rowMeans(myMA[,x, ...

View answer
GAM with the negative binomial distribution: why do predictions no match with original values?
5 votes

Copy of my response to identical cross-posted question on Rhelp: You have an offset that is not described. And gam suppresses the Intercept. These would seem to be likely sources of confusion. For ...

View answer
Contrasts to ANOVA in R
Accepted answer
5 votes

Look at ?contrasts and ?lm. The default contrasts in R are different than those of SAS, but the difference is explained and you can specify the alternate form. (Am I correct in thinking you wanted to ...

View answer
Testing the normality assumption for repeated measures anova? (in R)
Accepted answer
5 votes

You may not get a simple response to residuals(npk.aovE) but that does not mean there are no residuals in that object. Do str and see that within the levels there are still residuals. I would imagine ...

View answer
How sum of squares is calculated by R ANOVA function fo non-factor variables in linear model
Accepted answer
4 votes

One method (the easiest to grasp in one sentence) is to look at the increment in sums of squares due to regression when a covariate is added. This is R's ANOVA (or AOV) strategy, which implies that ...

View answer
What is the difference between two-sided and one-sided fisher exact test?
Accepted answer
4 votes

You want a one-sided test from the phrasing of your question. Your “null hypothesis”: Stat1's proportion of Group1 is greater than Stat2's proportion of Group1, is directional. You point out the ...

View answer
Expected survival time from log-logistic survival model in R from survreg
Accepted answer
4 votes

Seems that this was more of a coding question and might have gotten a more prompt coding response on StackOverflow, but since no close votes have been offered I put in a belated CV response. Most R ...

View answer
1
2 3 4 5
7