Zero-inflated model predicting only a small range of values. I need help Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Please help me refine this zero-inflated negative binomial modelZero inflated Poisson modelWhen to use zero-inflated poisson regression and negative binomial distributionTransform response for hurdle modelInterpreting results from distribution fittingZero-inflated model does not produce zeroes in fitted values?Predict function on negative binomial produces strange fitted values when adding an offsetNeed for zero-inflated poisson even though model fits data?zero inflated poisson iregression AIC valuesDeviance residual for zero-inflated Poisson model
How is an IPA symbol that lacks a name (e.g. ɲ) called?
Can gravitational waves pass through a black hole?
Proving inequality for positive definite matrix
A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?
A journey... into the MIND
Raising a bilingual kid. When should we introduce the majority language?
Why aren't road bike wheels tiny?
Is there a verb for listening stealthily?
“Since the train was delayed for more than an hour, passengers were given a full refund.” – Why is there no article before “passengers”?
Im stuck and having trouble with ¬P ∨ Q Prove: P → Q
How to make an animal which can only breed for a certain number of generations?
Is "ein Herz wie das meine" an antiquated or colloquial use of the possesive pronoun?
Sorting the characters in a utf-16 string in java
What's the connection between Mr. Nancy and fried chicken?
What kind of equipment or other technology is necessary to photograph sprites (atmospheric phenomenon)
What is the ongoing value of the Kanban board to the developers as opposed to management
Marquee sign letters
Trying to enter the Fox's den
Does traveling In The United States require a passport or can I use my green card if not a US citizen?
How to keep bees out of canned beverages?
Knights and Knaves question
Normal Operator || T^2|| = ||T||^2
Coin Game with infinite paradox
Why do C and C++ allow the expression (int) + 4*5?
Zero-inflated model predicting only a small range of values. I need help
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)Please help me refine this zero-inflated negative binomial modelZero inflated Poisson modelWhen to use zero-inflated poisson regression and negative binomial distributionTransform response for hurdle modelInterpreting results from distribution fittingZero-inflated model does not produce zeroes in fitted values?Predict function on negative binomial produces strange fitted values when adding an offsetNeed for zero-inflated poisson even though model fits data?zero inflated poisson iregression AIC valuesDeviance residual for zero-inflated Poisson model
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I built a ZI model and it is producing predicted values that are from a very small range when compared to the observed values. Plus it does not produce any zeros. See the fitted vs. observed graph below.
http://tinypic.com/r/16bbrxs/9
My model structure is given below. My response is a count variable and the predictor is continuous water level measurements (scaled).
m.u.meanwl.gu <- zeroinfl(GU ~ MeanWLScaled | MeanWLScaled, data = uluabat_wl_fg, dist = "negbin", link = "logit")
I need help to figure out what's wrong and fix it. Thanks in advance.
r prediction zero-inflation
$endgroup$
add a comment |
$begingroup$
I built a ZI model and it is producing predicted values that are from a very small range when compared to the observed values. Plus it does not produce any zeros. See the fitted vs. observed graph below.
http://tinypic.com/r/16bbrxs/9
My model structure is given below. My response is a count variable and the predictor is continuous water level measurements (scaled).
m.u.meanwl.gu <- zeroinfl(GU ~ MeanWLScaled | MeanWLScaled, data = uluabat_wl_fg, dist = "negbin", link = "logit")
I need help to figure out what's wrong and fix it. Thanks in advance.
r prediction zero-inflation
$endgroup$
add a comment |
$begingroup$
I built a ZI model and it is producing predicted values that are from a very small range when compared to the observed values. Plus it does not produce any zeros. See the fitted vs. observed graph below.
http://tinypic.com/r/16bbrxs/9
My model structure is given below. My response is a count variable and the predictor is continuous water level measurements (scaled).
m.u.meanwl.gu <- zeroinfl(GU ~ MeanWLScaled | MeanWLScaled, data = uluabat_wl_fg, dist = "negbin", link = "logit")
I need help to figure out what's wrong and fix it. Thanks in advance.
r prediction zero-inflation
$endgroup$
I built a ZI model and it is producing predicted values that are from a very small range when compared to the observed values. Plus it does not produce any zeros. See the fitted vs. observed graph below.
http://tinypic.com/r/16bbrxs/9
My model structure is given below. My response is a count variable and the predictor is continuous water level measurements (scaled).
m.u.meanwl.gu <- zeroinfl(GU ~ MeanWLScaled | MeanWLScaled, data = uluabat_wl_fg, dist = "negbin", link = "logit")
I need help to figure out what's wrong and fix it. Thanks in advance.
r prediction zero-inflation
r prediction zero-inflation
edited yesterday
Stephan Kolassa
48.1k8101180
48.1k8101180
asked yesterday
KO 88KO 88
697
697
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
If you call predict.zeroinfl()
without any parameters, it uses the default setting for the type
parameter, which is type="response"
. You will then get a prediction for the mean, or the expected response. This expectation will typically vary much less than your actual observations, will not be integer, and will be larger than zero.
To obtain a probabilistic prediction of the probabilities to observe specific actual count observations, use type="prob"
. An example:
> library(pscl)
> fm_zip <- zeroinfl(art ~ ., data = bioChemists)
> head(predict(fm_zip))
1 2 3 4 5 6
2.037956 1.323124 1.308704 1.439982 2.363233 0.854771
> head(predict(fm_zip,type="prob"))
0 1 2 3 4 5 6
1 0.2162690 0.1937560 0.2279639 0.17880748 0.10518810 0.049503684 0.019414543
2 0.3626973 0.2429423 0.2058847 0.11631983 0.04928840 0.016708046 0.004719819
3 0.3655549 0.2445794 0.2051107 0.11467420 0.04808441 0.016129943 0.004508999
4 0.3582308 0.2127514 0.2034182 0.12966290 0.06198734 0.023707199 0.007555727
5 0.1071273 0.2125181 0.2559524 0.20550920 0.12375553 0.059619449 0.023934814
6 0.5218005 0.2328010 0.1513963 0.06563783 0.02134296 0.005551943 0.001203522
7 8 9 10 11 12
1 0.006526345 0.0019196452 5.019025e-04 1.181028e-04 2.526437e-05 4.954139e-06
2 0.001142821 0.0002421248 4.559820e-05 7.728561e-06 1.190849e-06 1.682002e-07
3 0.001080390 0.0002265110 4.221291e-05 7.080172e-06 1.079567e-06 1.508923e-07
4 0.002064075 0.0004933813 1.048304e-04 2.004632e-05 3.484891e-06 5.553353e-07
5 0.008236171 0.0024798688 6.637118e-04 1.598722e-04 3.500850e-05 7.027254e-06
6 0.000223623 0.0000363569 5.254177e-06 6.833844e-07 8.080398e-08 8.758139e-09
13 14 15 16 17 18
1 8.967384e-07 1.507227e-07 2.364440e-08 3.477356e-09 4.813281e-10 6.292303e-11
2 2.192977e-08 2.654955e-09 2.999969e-10 3.177955e-11 3.168471e-12 2.983515e-13
3 1.946804e-08 2.332345e-09 2.607955e-10 2.733875e-11 2.697294e-12 2.513358e-13
4 8.168817e-08 1.115779e-08 1.422441e-09 1.700050e-10 1.912317e-11 2.031584e-12
5 1.302074e-06 2.240273e-07 3.597518e-08 5.415971e-09 7.673982e-10 1.026932e-10
6 8.762517e-10 8.140690e-11 7.058791e-12 5.738134e-13 4.390178e-14 3.172269e-15
19
1 7.792861e-12
2 2.661494e-14
3 2.218703e-14
4 2.044694e-13
5 1.301911e-11
6 2.171585e-16
>
Look at ?predict.zeroinfl
for more information.
$endgroup$
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of"pscl"
package. So I simply used the genericpredict()
function withtype ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for eitherzeroinfl
orglmmTMB
objects.
$endgroup$
– KO 88
yesterday
$begingroup$
predict.zeroinfl()
is available inpscl
1.5.2, see p. 60 in the reference manual. ...
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "65"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f404238%2fzero-inflated-model-predicting-only-a-small-range-of-values-i-need-help%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
If you call predict.zeroinfl()
without any parameters, it uses the default setting for the type
parameter, which is type="response"
. You will then get a prediction for the mean, or the expected response. This expectation will typically vary much less than your actual observations, will not be integer, and will be larger than zero.
To obtain a probabilistic prediction of the probabilities to observe specific actual count observations, use type="prob"
. An example:
> library(pscl)
> fm_zip <- zeroinfl(art ~ ., data = bioChemists)
> head(predict(fm_zip))
1 2 3 4 5 6
2.037956 1.323124 1.308704 1.439982 2.363233 0.854771
> head(predict(fm_zip,type="prob"))
0 1 2 3 4 5 6
1 0.2162690 0.1937560 0.2279639 0.17880748 0.10518810 0.049503684 0.019414543
2 0.3626973 0.2429423 0.2058847 0.11631983 0.04928840 0.016708046 0.004719819
3 0.3655549 0.2445794 0.2051107 0.11467420 0.04808441 0.016129943 0.004508999
4 0.3582308 0.2127514 0.2034182 0.12966290 0.06198734 0.023707199 0.007555727
5 0.1071273 0.2125181 0.2559524 0.20550920 0.12375553 0.059619449 0.023934814
6 0.5218005 0.2328010 0.1513963 0.06563783 0.02134296 0.005551943 0.001203522
7 8 9 10 11 12
1 0.006526345 0.0019196452 5.019025e-04 1.181028e-04 2.526437e-05 4.954139e-06
2 0.001142821 0.0002421248 4.559820e-05 7.728561e-06 1.190849e-06 1.682002e-07
3 0.001080390 0.0002265110 4.221291e-05 7.080172e-06 1.079567e-06 1.508923e-07
4 0.002064075 0.0004933813 1.048304e-04 2.004632e-05 3.484891e-06 5.553353e-07
5 0.008236171 0.0024798688 6.637118e-04 1.598722e-04 3.500850e-05 7.027254e-06
6 0.000223623 0.0000363569 5.254177e-06 6.833844e-07 8.080398e-08 8.758139e-09
13 14 15 16 17 18
1 8.967384e-07 1.507227e-07 2.364440e-08 3.477356e-09 4.813281e-10 6.292303e-11
2 2.192977e-08 2.654955e-09 2.999969e-10 3.177955e-11 3.168471e-12 2.983515e-13
3 1.946804e-08 2.332345e-09 2.607955e-10 2.733875e-11 2.697294e-12 2.513358e-13
4 8.168817e-08 1.115779e-08 1.422441e-09 1.700050e-10 1.912317e-11 2.031584e-12
5 1.302074e-06 2.240273e-07 3.597518e-08 5.415971e-09 7.673982e-10 1.026932e-10
6 8.762517e-10 8.140690e-11 7.058791e-12 5.738134e-13 4.390178e-14 3.172269e-15
19
1 7.792861e-12
2 2.661494e-14
3 2.218703e-14
4 2.044694e-13
5 1.301911e-11
6 2.171585e-16
>
Look at ?predict.zeroinfl
for more information.
$endgroup$
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of"pscl"
package. So I simply used the genericpredict()
function withtype ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for eitherzeroinfl
orglmmTMB
objects.
$endgroup$
– KO 88
yesterday
$begingroup$
predict.zeroinfl()
is available inpscl
1.5.2, see p. 60 in the reference manual. ...
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
add a comment |
$begingroup$
If you call predict.zeroinfl()
without any parameters, it uses the default setting for the type
parameter, which is type="response"
. You will then get a prediction for the mean, or the expected response. This expectation will typically vary much less than your actual observations, will not be integer, and will be larger than zero.
To obtain a probabilistic prediction of the probabilities to observe specific actual count observations, use type="prob"
. An example:
> library(pscl)
> fm_zip <- zeroinfl(art ~ ., data = bioChemists)
> head(predict(fm_zip))
1 2 3 4 5 6
2.037956 1.323124 1.308704 1.439982 2.363233 0.854771
> head(predict(fm_zip,type="prob"))
0 1 2 3 4 5 6
1 0.2162690 0.1937560 0.2279639 0.17880748 0.10518810 0.049503684 0.019414543
2 0.3626973 0.2429423 0.2058847 0.11631983 0.04928840 0.016708046 0.004719819
3 0.3655549 0.2445794 0.2051107 0.11467420 0.04808441 0.016129943 0.004508999
4 0.3582308 0.2127514 0.2034182 0.12966290 0.06198734 0.023707199 0.007555727
5 0.1071273 0.2125181 0.2559524 0.20550920 0.12375553 0.059619449 0.023934814
6 0.5218005 0.2328010 0.1513963 0.06563783 0.02134296 0.005551943 0.001203522
7 8 9 10 11 12
1 0.006526345 0.0019196452 5.019025e-04 1.181028e-04 2.526437e-05 4.954139e-06
2 0.001142821 0.0002421248 4.559820e-05 7.728561e-06 1.190849e-06 1.682002e-07
3 0.001080390 0.0002265110 4.221291e-05 7.080172e-06 1.079567e-06 1.508923e-07
4 0.002064075 0.0004933813 1.048304e-04 2.004632e-05 3.484891e-06 5.553353e-07
5 0.008236171 0.0024798688 6.637118e-04 1.598722e-04 3.500850e-05 7.027254e-06
6 0.000223623 0.0000363569 5.254177e-06 6.833844e-07 8.080398e-08 8.758139e-09
13 14 15 16 17 18
1 8.967384e-07 1.507227e-07 2.364440e-08 3.477356e-09 4.813281e-10 6.292303e-11
2 2.192977e-08 2.654955e-09 2.999969e-10 3.177955e-11 3.168471e-12 2.983515e-13
3 1.946804e-08 2.332345e-09 2.607955e-10 2.733875e-11 2.697294e-12 2.513358e-13
4 8.168817e-08 1.115779e-08 1.422441e-09 1.700050e-10 1.912317e-11 2.031584e-12
5 1.302074e-06 2.240273e-07 3.597518e-08 5.415971e-09 7.673982e-10 1.026932e-10
6 8.762517e-10 8.140690e-11 7.058791e-12 5.738134e-13 4.390178e-14 3.172269e-15
19
1 7.792861e-12
2 2.661494e-14
3 2.218703e-14
4 2.044694e-13
5 1.301911e-11
6 2.171585e-16
>
Look at ?predict.zeroinfl
for more information.
$endgroup$
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of"pscl"
package. So I simply used the genericpredict()
function withtype ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for eitherzeroinfl
orglmmTMB
objects.
$endgroup$
– KO 88
yesterday
$begingroup$
predict.zeroinfl()
is available inpscl
1.5.2, see p. 60 in the reference manual. ...
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
add a comment |
$begingroup$
If you call predict.zeroinfl()
without any parameters, it uses the default setting for the type
parameter, which is type="response"
. You will then get a prediction for the mean, or the expected response. This expectation will typically vary much less than your actual observations, will not be integer, and will be larger than zero.
To obtain a probabilistic prediction of the probabilities to observe specific actual count observations, use type="prob"
. An example:
> library(pscl)
> fm_zip <- zeroinfl(art ~ ., data = bioChemists)
> head(predict(fm_zip))
1 2 3 4 5 6
2.037956 1.323124 1.308704 1.439982 2.363233 0.854771
> head(predict(fm_zip,type="prob"))
0 1 2 3 4 5 6
1 0.2162690 0.1937560 0.2279639 0.17880748 0.10518810 0.049503684 0.019414543
2 0.3626973 0.2429423 0.2058847 0.11631983 0.04928840 0.016708046 0.004719819
3 0.3655549 0.2445794 0.2051107 0.11467420 0.04808441 0.016129943 0.004508999
4 0.3582308 0.2127514 0.2034182 0.12966290 0.06198734 0.023707199 0.007555727
5 0.1071273 0.2125181 0.2559524 0.20550920 0.12375553 0.059619449 0.023934814
6 0.5218005 0.2328010 0.1513963 0.06563783 0.02134296 0.005551943 0.001203522
7 8 9 10 11 12
1 0.006526345 0.0019196452 5.019025e-04 1.181028e-04 2.526437e-05 4.954139e-06
2 0.001142821 0.0002421248 4.559820e-05 7.728561e-06 1.190849e-06 1.682002e-07
3 0.001080390 0.0002265110 4.221291e-05 7.080172e-06 1.079567e-06 1.508923e-07
4 0.002064075 0.0004933813 1.048304e-04 2.004632e-05 3.484891e-06 5.553353e-07
5 0.008236171 0.0024798688 6.637118e-04 1.598722e-04 3.500850e-05 7.027254e-06
6 0.000223623 0.0000363569 5.254177e-06 6.833844e-07 8.080398e-08 8.758139e-09
13 14 15 16 17 18
1 8.967384e-07 1.507227e-07 2.364440e-08 3.477356e-09 4.813281e-10 6.292303e-11
2 2.192977e-08 2.654955e-09 2.999969e-10 3.177955e-11 3.168471e-12 2.983515e-13
3 1.946804e-08 2.332345e-09 2.607955e-10 2.733875e-11 2.697294e-12 2.513358e-13
4 8.168817e-08 1.115779e-08 1.422441e-09 1.700050e-10 1.912317e-11 2.031584e-12
5 1.302074e-06 2.240273e-07 3.597518e-08 5.415971e-09 7.673982e-10 1.026932e-10
6 8.762517e-10 8.140690e-11 7.058791e-12 5.738134e-13 4.390178e-14 3.172269e-15
19
1 7.792861e-12
2 2.661494e-14
3 2.218703e-14
4 2.044694e-13
5 1.301911e-11
6 2.171585e-16
>
Look at ?predict.zeroinfl
for more information.
$endgroup$
If you call predict.zeroinfl()
without any parameters, it uses the default setting for the type
parameter, which is type="response"
. You will then get a prediction for the mean, or the expected response. This expectation will typically vary much less than your actual observations, will not be integer, and will be larger than zero.
To obtain a probabilistic prediction of the probabilities to observe specific actual count observations, use type="prob"
. An example:
> library(pscl)
> fm_zip <- zeroinfl(art ~ ., data = bioChemists)
> head(predict(fm_zip))
1 2 3 4 5 6
2.037956 1.323124 1.308704 1.439982 2.363233 0.854771
> head(predict(fm_zip,type="prob"))
0 1 2 3 4 5 6
1 0.2162690 0.1937560 0.2279639 0.17880748 0.10518810 0.049503684 0.019414543
2 0.3626973 0.2429423 0.2058847 0.11631983 0.04928840 0.016708046 0.004719819
3 0.3655549 0.2445794 0.2051107 0.11467420 0.04808441 0.016129943 0.004508999
4 0.3582308 0.2127514 0.2034182 0.12966290 0.06198734 0.023707199 0.007555727
5 0.1071273 0.2125181 0.2559524 0.20550920 0.12375553 0.059619449 0.023934814
6 0.5218005 0.2328010 0.1513963 0.06563783 0.02134296 0.005551943 0.001203522
7 8 9 10 11 12
1 0.006526345 0.0019196452 5.019025e-04 1.181028e-04 2.526437e-05 4.954139e-06
2 0.001142821 0.0002421248 4.559820e-05 7.728561e-06 1.190849e-06 1.682002e-07
3 0.001080390 0.0002265110 4.221291e-05 7.080172e-06 1.079567e-06 1.508923e-07
4 0.002064075 0.0004933813 1.048304e-04 2.004632e-05 3.484891e-06 5.553353e-07
5 0.008236171 0.0024798688 6.637118e-04 1.598722e-04 3.500850e-05 7.027254e-06
6 0.000223623 0.0000363569 5.254177e-06 6.833844e-07 8.080398e-08 8.758139e-09
13 14 15 16 17 18
1 8.967384e-07 1.507227e-07 2.364440e-08 3.477356e-09 4.813281e-10 6.292303e-11
2 2.192977e-08 2.654955e-09 2.999969e-10 3.177955e-11 3.168471e-12 2.983515e-13
3 1.946804e-08 2.332345e-09 2.607955e-10 2.733875e-11 2.697294e-12 2.513358e-13
4 8.168817e-08 1.115779e-08 1.422441e-09 1.700050e-10 1.912317e-11 2.031584e-12
5 1.302074e-06 2.240273e-07 3.597518e-08 5.415971e-09 7.673982e-10 1.026932e-10
6 8.762517e-10 8.140690e-11 7.058791e-12 5.738134e-13 4.390178e-14 3.172269e-15
19
1 7.792861e-12
2 2.661494e-14
3 2.218703e-14
4 2.044694e-13
5 1.301911e-11
6 2.171585e-16
>
Look at ?predict.zeroinfl
for more information.
answered yesterday
Stephan KolassaStephan Kolassa
48.1k8101180
48.1k8101180
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of"pscl"
package. So I simply used the genericpredict()
function withtype ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for eitherzeroinfl
orglmmTMB
objects.
$endgroup$
– KO 88
yesterday
$begingroup$
predict.zeroinfl()
is available inpscl
1.5.2, see p. 60 in the reference manual. ...
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
add a comment |
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of"pscl"
package. So I simply used the genericpredict()
function withtype ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for eitherzeroinfl
orglmmTMB
objects.
$endgroup$
– KO 88
yesterday
$begingroup$
predict.zeroinfl()
is available inpscl
1.5.2, see p. 60 in the reference manual. ...
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of
"pscl"
package. So I simply used the generic predict()
function with type ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for either zeroinfl
or glmmTMB
objects.$endgroup$
– KO 88
yesterday
$begingroup$
Thank you for your reply, Sir. I understood what you said. However, this function is no longer available in the most recent form of
"pscl"
package. So I simply used the generic predict()
function with type ="prob"
command. It gave me a huge object with tons of numbers in it. It basically has probabilities for each possible value I guess. All I want to do is to use a basic predicted vs observed graph to see how well my model is performing and I still can't do it. Is there a way to get this plot by the method you said for either zeroinfl
or glmmTMB
objects.$endgroup$
– KO 88
yesterday
$begingroup$
predict.zeroinfl()
is available in pscl
1.5.2, see p. 60 in the reference manual. ...$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
predict.zeroinfl()
is available in pscl
1.5.2, see p. 60 in the reference manual. ...$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
$begingroup$
... About getting a predicted vs. observed graph: there are different ways of predicting. What you had originally was a plot of predicted expectations. Which does not give an indication of variability. You could extract predicted probabilities, then calculate lower and upper quantiles and plot those. Then you could check whether, e.g., 80% of observations are between the 10% and the 90% quantile prediction.
$endgroup$
– Stephan Kolassa
yesterday
add a comment |
Thanks for contributing an answer to Cross Validated!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f404238%2fzero-inflated-model-predicting-only-a-small-range-of-values-i-need-help%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown