how to check a propriety using r studioSquare root of Chi-square distribution tends to $N(0,1)$Relationship between chi-squared and standard normal distributions.How to check $H_0$ hypothesis using Pearson's criteria?Bivariate Normal Distribution Problem vs MarginalsShow that $Y = sum_i=1^n Y_i$ is distributed as $chi _2n^2$.If I have that $X sim chi^2_1$ and $Y sim chi^2_2$ are independent, how can I show that $4XY sim Y^2$?Chi-square test to check sampled varianceNormal distributionHypothesis testing: mean comparisonShow $1 + z_alpha/2/sqrtn approx chi^2_alpha/2 (2n)/(2n)$
Are the number of citations and number of published articles the most important criteria for a tenure promotion?
How to format long polynomial?
Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?
LWC SFDX source push error TypeError: LWC1009: decl.moveTo is not a function
Maximum likelihood parameters deviate from posterior distributions
DC-DC converter from low voltage at high current, to high voltage at low current
Why are electrically insulating heatsinks so rare? Is it just cost?
Has there ever been an airliner design involving reducing generator load by installing solar panels?
I'm flying to France today and my passport expires in less than 2 months
NMaximize is not converging to a solution
Alternative to sending password over mail?
Is it inappropriate for a student to attend their mentor's dissertation defense?
Codimension of non-flat locus
How to determine what difficulty is right for the game?
Why can't we play rap on piano?
Do infinite dimensional systems make sense?
Important Resources for Dark Age Civilizations?
Intersection point of 2 lines defined by 2 points each
How does one intimidate enemies without having the capacity for violence?
What's the point of deactivating Num Lock on login screens?
How old can references or sources in a thesis be?
What is the word for reserving something for yourself before others do?
Malformed Address '10.10.21.08/24', must be X.X.X.X/NN or
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
how to check a propriety using r studio
Square root of Chi-square distribution tends to $N(0,1)$Relationship between chi-squared and standard normal distributions.How to check $H_0$ hypothesis using Pearson's criteria?Bivariate Normal Distribution Problem vs MarginalsShow that $Y = sum_i=1^n Y_i$ is distributed as $chi _2n^2$.If I have that $X sim chi^2_1$ and $Y sim chi^2_2$ are independent, how can I show that $4XY sim Y^2$?Chi-square test to check sampled varianceNormal distributionHypothesis testing: mean comparisonShow $1 + z_alpha/2/sqrtn approx chi^2_alpha/2 (2n)/(2n)$
$begingroup$
I have to check that this propriety
$Z sim N(0,1)$ and $Usim chi ^2(10)$ then $ Z/sqrtU/10 sim T(10)$
is true using r studio if anyone can help , much appreciate
probability statistics hypothesis-testing
$endgroup$
add a comment |
$begingroup$
I have to check that this propriety
$Z sim N(0,1)$ and $Usim chi ^2(10)$ then $ Z/sqrtU/10 sim T(10)$
is true using r studio if anyone can help , much appreciate
probability statistics hypothesis-testing
$endgroup$
3
$begingroup$
What do you mean by "verify using R"? A programming language cannot rigorously verify this although it may produce evidence suggesting it is true. If you read the definition of a $t$-distribution, then your question follows almost immediately.
$endgroup$
– angryavian
10 hours ago
$begingroup$
@angryavian : Maybe not in r studio (although I don't know all the capabilities of R), but there's a thing called computer-assisted proofs.
$endgroup$
– Raskolnikov
7 hours ago
$begingroup$
@angryavian you can use R to sample from the distributions in question and use that to do some hypothesis testing.
$endgroup$
– JJJ
6 hours ago
add a comment |
$begingroup$
I have to check that this propriety
$Z sim N(0,1)$ and $Usim chi ^2(10)$ then $ Z/sqrtU/10 sim T(10)$
is true using r studio if anyone can help , much appreciate
probability statistics hypothesis-testing
$endgroup$
I have to check that this propriety
$Z sim N(0,1)$ and $Usim chi ^2(10)$ then $ Z/sqrtU/10 sim T(10)$
is true using r studio if anyone can help , much appreciate
probability statistics hypothesis-testing
probability statistics hypothesis-testing
asked 10 hours ago
JoshuaKJoshuaK
305
305
3
$begingroup$
What do you mean by "verify using R"? A programming language cannot rigorously verify this although it may produce evidence suggesting it is true. If you read the definition of a $t$-distribution, then your question follows almost immediately.
$endgroup$
– angryavian
10 hours ago
$begingroup$
@angryavian : Maybe not in r studio (although I don't know all the capabilities of R), but there's a thing called computer-assisted proofs.
$endgroup$
– Raskolnikov
7 hours ago
$begingroup$
@angryavian you can use R to sample from the distributions in question and use that to do some hypothesis testing.
$endgroup$
– JJJ
6 hours ago
add a comment |
3
$begingroup$
What do you mean by "verify using R"? A programming language cannot rigorously verify this although it may produce evidence suggesting it is true. If you read the definition of a $t$-distribution, then your question follows almost immediately.
$endgroup$
– angryavian
10 hours ago
$begingroup$
@angryavian : Maybe not in r studio (although I don't know all the capabilities of R), but there's a thing called computer-assisted proofs.
$endgroup$
– Raskolnikov
7 hours ago
$begingroup$
@angryavian you can use R to sample from the distributions in question and use that to do some hypothesis testing.
$endgroup$
– JJJ
6 hours ago
3
3
$begingroup$
What do you mean by "verify using R"? A programming language cannot rigorously verify this although it may produce evidence suggesting it is true. If you read the definition of a $t$-distribution, then your question follows almost immediately.
$endgroup$
– angryavian
10 hours ago
$begingroup$
What do you mean by "verify using R"? A programming language cannot rigorously verify this although it may produce evidence suggesting it is true. If you read the definition of a $t$-distribution, then your question follows almost immediately.
$endgroup$
– angryavian
10 hours ago
$begingroup$
@angryavian : Maybe not in r studio (although I don't know all the capabilities of R), but there's a thing called computer-assisted proofs.
$endgroup$
– Raskolnikov
7 hours ago
$begingroup$
@angryavian : Maybe not in r studio (although I don't know all the capabilities of R), but there's a thing called computer-assisted proofs.
$endgroup$
– Raskolnikov
7 hours ago
$begingroup$
@angryavian you can use R to sample from the distributions in question and use that to do some hypothesis testing.
$endgroup$
– JJJ
6 hours ago
$begingroup$
@angryavian you can use R to sample from the distributions in question and use that to do some hypothesis testing.
$endgroup$
– JJJ
6 hours ago
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
One approach could be simulation of thousands of values:
- Simulate $Z$ using
rnorm
- Simulate $U$ using
rchisq
- Do the division $Y = Z / sqrtU / 10$
- Simulate the same number of $T$ from the hypothesised $t$-distribution using
rt
- Sort $Y$ and $T$ and plot them against each other - you want to see a diagonal straight line essentially $y=x$ with a little noise; this is visual demonstration though not a proof that the distributions are the same
You can do similar things with the qqplot
function if you know what you are doing
$endgroup$
add a comment |
$begingroup$
I agree with @angryavian that you can't do a 'proof' in R.
Also, it is crucial to state that random variables $Z$
and $U$ are independent. Then $Y = fracZU/sqrt10 sim mathsfT(10)$ by definition.
Here is R code to simulate a million values of $T$ [as in the Answer of @Henry (+1)], then to compare their histogram with the density of $mathsfT(10).$ This
is a graphical demonstration that $T$ has (at least very nearly) the claimed t distribution.
set.seed(405) # for reproducibility
z = rnorm(10^6); u = rchisq(10^6, 10)
y = z/sqrt(u/10)
hist(y, prob=T, br=50, col="skyblue2")
curve(dt(x, 10), add=T, lwd=2)
Furthermore, you could check that the quantiles of $Y$ very nearly match the theoretical quantiles of $mathsfT(10).$
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.641101 -0.699409 0.000059 0.000221 0.701253 9.802922
qt(c(.25,.5,.75), 10)
[1] -0.6998121 0.0000000 0.6998121
The summary above also shows that $bar Y approx 0.$ And the sample variance of the simulated values of $Y$ is very nearly the variance $nu/(nu - 2) = 10/8 = 1.25$ of Student's t distribution with $nu = 10$ degrees of freedom.
[In effect, two of the moments suggested by #GeorgeDewhirts (+1).]
var(y); 10/8
[1] 1.250115
[1] 1.25
Also, you could do a Kolmogorov-Smirnov goodness-of-fit test on the first 5000 values of $Y$ and check that the P-value exceeds 5%. (The K-S test in R is limited to 5000 observations.) Roughly speaking, this is a formal, quantitative way to do @Henry's comparison of sorted observations.
ks.test(y[1:5000], pt, 10)
One-sample Kolmogorov-Smirnov test
data: y[1:5000]
D = 0.013661, p-value = 0.3083
alternative hypothesis: two-sided
$endgroup$
add a comment |
$begingroup$
You could compare the moments of your distribution with the theoretical moments of $T(10)$
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
,
noCode: 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%2fmath.stackexchange.com%2fquestions%2f3176151%2fhow-to-check-a-propriety-using-r-studio%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
One approach could be simulation of thousands of values:
- Simulate $Z$ using
rnorm
- Simulate $U$ using
rchisq
- Do the division $Y = Z / sqrtU / 10$
- Simulate the same number of $T$ from the hypothesised $t$-distribution using
rt
- Sort $Y$ and $T$ and plot them against each other - you want to see a diagonal straight line essentially $y=x$ with a little noise; this is visual demonstration though not a proof that the distributions are the same
You can do similar things with the qqplot
function if you know what you are doing
$endgroup$
add a comment |
$begingroup$
One approach could be simulation of thousands of values:
- Simulate $Z$ using
rnorm
- Simulate $U$ using
rchisq
- Do the division $Y = Z / sqrtU / 10$
- Simulate the same number of $T$ from the hypothesised $t$-distribution using
rt
- Sort $Y$ and $T$ and plot them against each other - you want to see a diagonal straight line essentially $y=x$ with a little noise; this is visual demonstration though not a proof that the distributions are the same
You can do similar things with the qqplot
function if you know what you are doing
$endgroup$
add a comment |
$begingroup$
One approach could be simulation of thousands of values:
- Simulate $Z$ using
rnorm
- Simulate $U$ using
rchisq
- Do the division $Y = Z / sqrtU / 10$
- Simulate the same number of $T$ from the hypothesised $t$-distribution using
rt
- Sort $Y$ and $T$ and plot them against each other - you want to see a diagonal straight line essentially $y=x$ with a little noise; this is visual demonstration though not a proof that the distributions are the same
You can do similar things with the qqplot
function if you know what you are doing
$endgroup$
One approach could be simulation of thousands of values:
- Simulate $Z$ using
rnorm
- Simulate $U$ using
rchisq
- Do the division $Y = Z / sqrtU / 10$
- Simulate the same number of $T$ from the hypothesised $t$-distribution using
rt
- Sort $Y$ and $T$ and plot them against each other - you want to see a diagonal straight line essentially $y=x$ with a little noise; this is visual demonstration though not a proof that the distributions are the same
You can do similar things with the qqplot
function if you know what you are doing
answered 9 hours ago
HenryHenry
101k482170
101k482170
add a comment |
add a comment |
$begingroup$
I agree with @angryavian that you can't do a 'proof' in R.
Also, it is crucial to state that random variables $Z$
and $U$ are independent. Then $Y = fracZU/sqrt10 sim mathsfT(10)$ by definition.
Here is R code to simulate a million values of $T$ [as in the Answer of @Henry (+1)], then to compare their histogram with the density of $mathsfT(10).$ This
is a graphical demonstration that $T$ has (at least very nearly) the claimed t distribution.
set.seed(405) # for reproducibility
z = rnorm(10^6); u = rchisq(10^6, 10)
y = z/sqrt(u/10)
hist(y, prob=T, br=50, col="skyblue2")
curve(dt(x, 10), add=T, lwd=2)
Furthermore, you could check that the quantiles of $Y$ very nearly match the theoretical quantiles of $mathsfT(10).$
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.641101 -0.699409 0.000059 0.000221 0.701253 9.802922
qt(c(.25,.5,.75), 10)
[1] -0.6998121 0.0000000 0.6998121
The summary above also shows that $bar Y approx 0.$ And the sample variance of the simulated values of $Y$ is very nearly the variance $nu/(nu - 2) = 10/8 = 1.25$ of Student's t distribution with $nu = 10$ degrees of freedom.
[In effect, two of the moments suggested by #GeorgeDewhirts (+1).]
var(y); 10/8
[1] 1.250115
[1] 1.25
Also, you could do a Kolmogorov-Smirnov goodness-of-fit test on the first 5000 values of $Y$ and check that the P-value exceeds 5%. (The K-S test in R is limited to 5000 observations.) Roughly speaking, this is a formal, quantitative way to do @Henry's comparison of sorted observations.
ks.test(y[1:5000], pt, 10)
One-sample Kolmogorov-Smirnov test
data: y[1:5000]
D = 0.013661, p-value = 0.3083
alternative hypothesis: two-sided
$endgroup$
add a comment |
$begingroup$
I agree with @angryavian that you can't do a 'proof' in R.
Also, it is crucial to state that random variables $Z$
and $U$ are independent. Then $Y = fracZU/sqrt10 sim mathsfT(10)$ by definition.
Here is R code to simulate a million values of $T$ [as in the Answer of @Henry (+1)], then to compare their histogram with the density of $mathsfT(10).$ This
is a graphical demonstration that $T$ has (at least very nearly) the claimed t distribution.
set.seed(405) # for reproducibility
z = rnorm(10^6); u = rchisq(10^6, 10)
y = z/sqrt(u/10)
hist(y, prob=T, br=50, col="skyblue2")
curve(dt(x, 10), add=T, lwd=2)
Furthermore, you could check that the quantiles of $Y$ very nearly match the theoretical quantiles of $mathsfT(10).$
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.641101 -0.699409 0.000059 0.000221 0.701253 9.802922
qt(c(.25,.5,.75), 10)
[1] -0.6998121 0.0000000 0.6998121
The summary above also shows that $bar Y approx 0.$ And the sample variance of the simulated values of $Y$ is very nearly the variance $nu/(nu - 2) = 10/8 = 1.25$ of Student's t distribution with $nu = 10$ degrees of freedom.
[In effect, two of the moments suggested by #GeorgeDewhirts (+1).]
var(y); 10/8
[1] 1.250115
[1] 1.25
Also, you could do a Kolmogorov-Smirnov goodness-of-fit test on the first 5000 values of $Y$ and check that the P-value exceeds 5%. (The K-S test in R is limited to 5000 observations.) Roughly speaking, this is a formal, quantitative way to do @Henry's comparison of sorted observations.
ks.test(y[1:5000], pt, 10)
One-sample Kolmogorov-Smirnov test
data: y[1:5000]
D = 0.013661, p-value = 0.3083
alternative hypothesis: two-sided
$endgroup$
add a comment |
$begingroup$
I agree with @angryavian that you can't do a 'proof' in R.
Also, it is crucial to state that random variables $Z$
and $U$ are independent. Then $Y = fracZU/sqrt10 sim mathsfT(10)$ by definition.
Here is R code to simulate a million values of $T$ [as in the Answer of @Henry (+1)], then to compare their histogram with the density of $mathsfT(10).$ This
is a graphical demonstration that $T$ has (at least very nearly) the claimed t distribution.
set.seed(405) # for reproducibility
z = rnorm(10^6); u = rchisq(10^6, 10)
y = z/sqrt(u/10)
hist(y, prob=T, br=50, col="skyblue2")
curve(dt(x, 10), add=T, lwd=2)
Furthermore, you could check that the quantiles of $Y$ very nearly match the theoretical quantiles of $mathsfT(10).$
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.641101 -0.699409 0.000059 0.000221 0.701253 9.802922
qt(c(.25,.5,.75), 10)
[1] -0.6998121 0.0000000 0.6998121
The summary above also shows that $bar Y approx 0.$ And the sample variance of the simulated values of $Y$ is very nearly the variance $nu/(nu - 2) = 10/8 = 1.25$ of Student's t distribution with $nu = 10$ degrees of freedom.
[In effect, two of the moments suggested by #GeorgeDewhirts (+1).]
var(y); 10/8
[1] 1.250115
[1] 1.25
Also, you could do a Kolmogorov-Smirnov goodness-of-fit test on the first 5000 values of $Y$ and check that the P-value exceeds 5%. (The K-S test in R is limited to 5000 observations.) Roughly speaking, this is a formal, quantitative way to do @Henry's comparison of sorted observations.
ks.test(y[1:5000], pt, 10)
One-sample Kolmogorov-Smirnov test
data: y[1:5000]
D = 0.013661, p-value = 0.3083
alternative hypothesis: two-sided
$endgroup$
I agree with @angryavian that you can't do a 'proof' in R.
Also, it is crucial to state that random variables $Z$
and $U$ are independent. Then $Y = fracZU/sqrt10 sim mathsfT(10)$ by definition.
Here is R code to simulate a million values of $T$ [as in the Answer of @Henry (+1)], then to compare their histogram with the density of $mathsfT(10).$ This
is a graphical demonstration that $T$ has (at least very nearly) the claimed t distribution.
set.seed(405) # for reproducibility
z = rnorm(10^6); u = rchisq(10^6, 10)
y = z/sqrt(u/10)
hist(y, prob=T, br=50, col="skyblue2")
curve(dt(x, 10), add=T, lwd=2)
Furthermore, you could check that the quantiles of $Y$ very nearly match the theoretical quantiles of $mathsfT(10).$
summary(y)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.641101 -0.699409 0.000059 0.000221 0.701253 9.802922
qt(c(.25,.5,.75), 10)
[1] -0.6998121 0.0000000 0.6998121
The summary above also shows that $bar Y approx 0.$ And the sample variance of the simulated values of $Y$ is very nearly the variance $nu/(nu - 2) = 10/8 = 1.25$ of Student's t distribution with $nu = 10$ degrees of freedom.
[In effect, two of the moments suggested by #GeorgeDewhirts (+1).]
var(y); 10/8
[1] 1.250115
[1] 1.25
Also, you could do a Kolmogorov-Smirnov goodness-of-fit test on the first 5000 values of $Y$ and check that the P-value exceeds 5%. (The K-S test in R is limited to 5000 observations.) Roughly speaking, this is a formal, quantitative way to do @Henry's comparison of sorted observations.
ks.test(y[1:5000], pt, 10)
One-sample Kolmogorov-Smirnov test
data: y[1:5000]
D = 0.013661, p-value = 0.3083
alternative hypothesis: two-sided
edited 7 hours ago
answered 8 hours ago
BruceETBruceET
36.2k71540
36.2k71540
add a comment |
add a comment |
$begingroup$
You could compare the moments of your distribution with the theoretical moments of $T(10)$
$endgroup$
add a comment |
$begingroup$
You could compare the moments of your distribution with the theoretical moments of $T(10)$
$endgroup$
add a comment |
$begingroup$
You could compare the moments of your distribution with the theoretical moments of $T(10)$
$endgroup$
You could compare the moments of your distribution with the theoretical moments of $T(10)$
answered 9 hours ago
George DewhirstGeorge Dewhirst
7164
7164
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- 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%2fmath.stackexchange.com%2fquestions%2f3176151%2fhow-to-check-a-propriety-using-r-studio%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
3
$begingroup$
What do you mean by "verify using R"? A programming language cannot rigorously verify this although it may produce evidence suggesting it is true. If you read the definition of a $t$-distribution, then your question follows almost immediately.
$endgroup$
– angryavian
10 hours ago
$begingroup$
@angryavian : Maybe not in r studio (although I don't know all the capabilities of R), but there's a thing called computer-assisted proofs.
$endgroup$
– Raskolnikov
7 hours ago
$begingroup$
@angryavian you can use R to sample from the distributions in question and use that to do some hypothesis testing.
$endgroup$
– JJJ
6 hours ago