Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Results for fitted resid
Search options not deleted
-1
votes
R: glm function with family = "binomial" and "weight" specification
(Intercept)
(Intercept) 2.333333 vcov() takes this one"
View(survey:::summary.svyglm)
"Shows that cov.unscaled = covmat, cov.scaled = covmat not scaled by dispersion
dispersion <- svyvar(resid … (object, 'pearson'), object$survey.design,
na.rm = TRUE)"
svyvar(resid(Model, 'pearson'), Model$survey.design, na.rm = TRUE)
" variance SE
[1,] 1.5 0 is what summary(Model)$dispersion uses …
2
votes
Accepted
Interpreting Negative Binomial residual plot
))
plot(simulateResiduals(m1))
And here it is with the offset omitted:
dd2 <- simfun(seed = 101, off = FALSE)
m2 <- with(dd2, MASS::glm.nb(form, data = data))
plot(simulateResiduals(m2))
Code for fitted … vs residual above:
ggplot(augment(m2), aes(.fitted, .resid)) + geom_point() + geom_smooth()
I looked for offset-related issues on the DHARMa issues page, but none of the hits here jumped out at me as …
4
votes
1
answer
124
views
How is Gaussian log likelihood value calculated in weighted LM, GLM and GLS?
~1/n
Coefficients:
Value Std.Error t-value p-value
(Intercept) 0.25 0.03535534 7.071068 0.0194
Residual standard error: 0.2236068
0.2236068 = 0.2738613 * sqrt(2/3) is underestimated resid … + residuals, mean = fitted, sd = sigma(Model)))))
"4.907056 matches above"
Remaining Question
Should the log likelihood value of OLS models be based on not the unbiased residual variance relationship …
0
votes
0
answers
24
views
Improving glmm accuracy - what can I do here?
colour:factor(treatment)
+ factor(treatment):factor(screening)
+ (1|id),
df, family=beta_family(link="logit")
)
For validating I've been using the following:
sresid=resid … (m1, type="pearson")
shapiro.test(sresid)
hist(sresid)
fits=fitted(m1)
plot(sresid~fits)
simulateResid <- simulateResiduals(m1) #from DHARMa package
plot(simulateResid)
I'm at a loss where to go after …
2
votes
2
answers
63
views
Resids vs fitted plot shows cyclical patterns. I have chosen 5 explanatory variables out of ...
Here is the resids vs fitted and qqplot of the model (obtained using 'plot(mod_och, type = 'residuals', series = 3)', the tails are heavy and residuals not normally distributed
I assumed the red line …
5
votes
Isn't it normal that residual plots for mixed effect models will show a trend?
(1)
N <- 500
R <- 4
subjects <- rep(factor(1:N),each = R)
mu <- rep(rnorm(N), each = R)
y <- mu + 0.2 * rnorm(N * R)
df <- data.frame(subjects, mu, y)
mdl <- lme4::lmer(y ~ 1 + (1|subjects), df)
plot(resid … (mdl) ~ fitted(mdl), col = "steelblue", pch = 16)
abline(coef(lm(resid(mdl) ~ fitted(mdl))), col = 2, lwd = 2)
One solution, provided by the DHARMa package, is to use simulated residuals conditional …
0
votes
0
answers
17
views
R – Model specification for TWO TIME variables AND PAIRED design in repeated measures genera...
(globalmodel, type="pearson")
fits<-fitted(globalmodel)
infl_model <- influence(globalmodel,obs=T)
cd_model <- cooks.distance(infl_model)
cd_thres <- 4/df_n
devresid<-resid(globalmodel … (model, type="pearson")
hist(sresid)
qqnorm(sresid); qqline(sresid, col="red")
fits<-fitted(model)
plot(sresid~fits)
boxplot(mydata$Response)
cooksd <- cooks.distance(model) %>% as.data.frame …
0
votes
0
answers
44
views
Constructing nomogram from approximate model in Regression Modelling Strategies
hypothetical data
f <- areg.boot(response ~ I(age) + monotone(blood.pressure) + race)
# use I(response) to not transform the response variable
plot(f, conf.int=.9)
# Check distribution of residuals
plot(fitted … (f), resid(f))
qqnorm(resid(f))
# Refit this model using ols so that we can draw a nomogram of it.
# The nomogram will show the linear predictor, median, mean.
# The last two are smearing estimators. …
0
votes
0
answers
11
views
How might I go about analyzing the affect that the number of attempts of something has on th...
Passing this into a linear model with a log-log transform, the qqplot and histogram looked pretty normal but the resid vs fitted was definitely off, but I don't know exactly what causes the behavior (pictured …
3
votes
Accepted
Linear Regression with Only Categorical Features: Evaluating the Model
To test heteroscedasticity, I recommend White’s general test, implemented as the fitted-value approach of a Breusch-Pagan test, lmtest::bptest(lm(), varformula = ~ fitted + I(fitted^2) + I(fitted^3)) after … saving fitted values into the data frame as fitted. …
3
votes
Accepted
lavaan's estimated residuals output different than manually estimated residuals
The fitted function and residual function are both standardized, just as Jeremy pointed out. … Try
resid_lavaan = resid(fit)$cov
resid_manually = lavInspect(fit, what = "sampstat")$cov - fitted(fit)$cov
You will find out that the resid_lavaan matches resid_manually. …
3
votes
From overdispersion to underdispersion: comparing linear regression models with DHARMa
The most common overdispersion tests in the literature — comparing (resid deviance)/(resid df) to 1, or (sum of [Pearson resids]^2)/(resid df) to 1, or computing the one-tailed p-value of resid deviance … In contrast, the DHARMa test is based on simulations from the fitted model — it is computationally intensive, but should be much more reliable. …
4
votes
2
answers
128
views
How to check linearity of a variable without plots/graphs in R?
(cpg1_gamm_cases$mer)
cpg1_r <- resid(cpg1_gamm_cases$mer)
plot(x = cpg1_f,
y = cpg1_r,
xlab = "Fitted values",
ylab = "Residuals",
cex = 0.3)
abline(lm(resid(cpg1_gamm_cases$mer) ~ … fitted(cpg1_gamm_cases$mer)))
result 1:
result 2:
The above plots show there is no clear linear relationship between cpg_1 and time. …
8
votes
1
answer
208
views
Is my intuition behind the weight matrix correct for quantile regression?
rnorm(200)
y <- (.40 * x) + rnorm(200)
plot(x,y)
#### Fit Q25 Regression ####
qu <- .25
fit <- rq(
y ~ x,
tau = qu
)
summary(fit)
#### Plot ####
broom::augment(fit) %>%
mutate(weight = ifelse(.resid … x <- rnorm(200)
y <- (.40 * x) + rnorm(200)
#### Fit Q001 Regression ####
qu <- .001
fit <- rq(
y ~ x,
tau = qu
)
summary(fit)
#### Plot ####
broom::augment(fit) %>%
mutate(weight = ifelse(.resid …
3
votes
1
answer
58
views
Model diagnosis in GLMM model of binary outcome variable
I got the following results or plots.
scatter.smooth(fitted(twoRIM), sqrt(abs(resid(twoRIM))), col=6)
qqline(resid(twoRIM))
plot(twoRIM)
qqnorm(resid(twoRIM),main="Residual normal plot",col=4,adj … (twoRIM),resid(twoRIM),col=4)
qqnorm(resid(twoRIM))
The plots I got — the residual and other related plots — are quite different from other forms of model diagnosis I knew before, and I faced a bit …