Closed ashokkrish closed 3 days ago
Hi Ashok! I've added the Population Standard Deviation radio button, as well as conditional panels for Sample Size (n) and Population Standard Deviation (σ). The conditional panels for Inference Types are both functioning per Mike Meyer's previous work.
Can you expand more on the Hypothesized Population Mean value? Additionally, is there a document I can refer to for sample values/formulas/calculations so I can test these new additions?
@samantha-v-brian
Hi Sam,
Thanks for working on this issue. Here are some follow-up requests on this same issue.
Display the following messages
On the mainPanel after all the validation checks out we will print the answer showing all the steps. For now if you can fix the above requests and push the code that'd great.
For the radioButton could you set inline = FALSE? This will set the options as follows
Hi Ashok!
The above requests have been fixed. I also added main panel error messages for Sample Size Estimation per the task on Google Docs, as I'd missed them previously when implementing validation.
EDIT: commented just as you added the inline request! Will fix right now
EDIT: Fixed and pushed
I am sorry about a minor confusion and it is entirely my fault,
In the radioButton choices it should be (this needs a fix)
but the numericInput should be (which is correct now)
In other words Population Standard Deviation is the Parameter of Interest and the Sample Standard Deviation is its point estimate.
Not a problem, it was an easy fix. I've pushed the change.
These formulae need to be the radicand so that the standard deviation is calculated, not the variance (as depicted); right, @ashokkrish?
@bryce-carson Yes, that's correct. Here is a another breakdown of steps,
Here is another fully worked out example
@bryce-carson Yes, that's correct. Here is a another breakdown of steps,
Here is another fully worked out example
Those reference materials work perfectly for me. Thanks.
@bryce-carson
Couple of examples to check the confidence interval results
@bryce-carson
I would the results displayed on the main panel in this sequence (I created this by patching a few screenshots into one)
https://www.easysevens.com/understanding-chi-square-critical-value-a-beginners-tutorial/
This really helped me.
* Don't need to bold the text "The confidence interval for σ is from"
For now it doesn't look exactly like that, but we will review it in the meeting.
The results are now correct, however.
The identifiers aren't the best.
@bryce-carson
When alpha/2 is calculated you can round it to two-digits not three, e.g. 10% as 0.10 and not 0.100 5% as 0.05 and not 0.050. 1% as 0.01 and not 0.010.
However
0.05/2 should indeed be 0.025 (three digits) 0.01/2 should indeed be 0.005 (three digits).
Returning to work on this tonight. Haven't done anything until now since we last spoke, @ashokkrish.
@bryce-carson
When alpha/2 is calculated you can round it to two-digits not three, e.g. 10% as 0.10 and not 0.100 5% as 0.05 and not 0.050. 1% as 0.01 and not 0.010.
However
0.05/2 should indeed be 0.025 (three digits) 0.01/2 should indeed be 0.005 (three digits).
@ashokkrish, I do not understand the request for a change here. Your statements are conflicting; do you mean the right-hand side of the equation, the Chi-square test value, should be rounded to two digits? Why mention alpha / 2 at all? I'm sorry, but I'm too confused to move forward on just this. Can you elaborate, please?
Why mention alpha / 2 at all?
We are constructing what is called as a two-sided confidence interval. This results in a lower confidence limit (LCL) and an upper confidence limit (UCL). I was simply being a little picky about the number of digits to display. Alpha is typically presented in two digits
10% as 0.10 and not 0.100 5% as 0.05 and not 0.050. 1% as 0.01 and not 0.010.
whereas
0.05/2 should indeed be 0.025 (three digits) 0.01/2 should indeed be 0.005 (three digits).
Does this help?
@ashokkrish What I will do for this issue otherwise is ensure that the user-provided values are displayed with the phrasing, "Given n, s, ..." et cetera before the calculations.
@ashokkrish What I will do for this issue otherwise is ensure that the user-provided values are displayed with the phrasing, "Given n, s, ..." et cetera before the calculations.
Follow the exact same format we used for confidence interval for population mean (mu) and population proportion (p).
Why mention alpha / 2 at all?
We are constructing what is called as a two-sided confidence interval. This results in a lower confidence limit (LCL) and an upper confidence limit (UCL). I was simply being a little pick about the number of digits to display.
Alpha is typically presented in two digits
10% as 0.10 and not 0.100 5% as 0.05 and not 0.050. 1% as 0.01 and not 0.010.
whereas
0.05/2 should indeed be 0.025 (three digits) 0.01/2 should indeed be 0.005 (three digits).
Does this help?
Oh! Yeah, that helps a lot. I'll reduce the digits of the alpha to two digits, so it displays like below. Is this right?
$$ \chi^2{1-\alpha/2} = \chi^2{1-0.05/2} = \chi^2_{0.975} $$
rather than
$$ \chi^2{1-\alpha/2} = \chi^2{1-0.050/2} = \chi^2_{0.975} $$
With the same change for the other side of the confidence interval.
@ashokkrish What I will do for this issue otherwise is ensure that the user-provided values are displayed with the phrasing, "Given n, s, ..." et cetera before the calculations.
Follow the exact same format we used for confidence interval for population mean (mu) and population proportion (p).
Will do!
I'll reduce the digits of the alpha to two digits, so it displays like below. Is this right?
This is perfect.
@ashokkrish, I have just pushed a commit which changes the formatting to what you desired. Please let me know if it is sufficient and I will close the issue.
@ashokkrish I will begin working on #33 now.
@ashokkrish, I have just pushed a commit which changes the formatting to what you desired. Please let me know if it is sufficient and I will close the issue.
@bryce-carson
If you look at the confidence interval for one population mean (mu) when sigma is unknown you will notice the following
Clarify alpha = 1 - 0.90/0.95/0.99 = 0.10/0.05/0.01
Same way, I would like you to embed the df in the subscripts of the calculations of
@bryce-carson
Left indent this and add a break between the rows.
@bryce-carson
The confidence level here must be expressed as 90%/95%/99%.
Replace the word lies with is.
I'm working on these tasks now, @ashokkrish. At the end of my day I'll let you know what progress I've made on #33. I fully expect all of these tasks to be completed within an hour or so, depending on how much trouble the align
environment gives me.
align
environment for the calculation of the CI, and add a line break between the aligned equations@bryce-carson
This is excellent. I look forward to testing the new code.
@ashokkrish, I have completed this work. Please see the pushed updated. I will begin work on #33 now.
@bryce-carson
Could you bring the CI = outside the parentheses?
Give a space after the comma.
@bryce-carson
Drop the word where and move the df calculation below alpha calculation. So something like this
newline
newline
@ashokkrish How is it now? If you'd like further spacing between the lower and upper CIs I can use \quad
instead of \;\:
.
@bryce-carson The spacing and CI workflow looks good.
I just encountered a validation bug. The sample size n must be greater than 1 (>1). However as it stands with the following numbers the resulting CI produces NaNs.
Can you check and fix this please?
@bryce-carson Follow-up to the above bug. When the user enters
Now click Calculate you will see
on the main panel.
Further if the user enters
Now click Calculate you will see
Clearly there is a conditional panel exception that is skipping some but not all validation.
@ashokkrish, interesting. I'll look at those validation issues.
@ashokkrish, I have fixed this issue.
conditional panel exception
A conditionalPanel controls visibility based on a condition, while a shinyvalidate input validation object uses a boolean function and a set of rules to test the validity of an input widget's data. They're separate concerns and concepts, just to refresh your memory.
@bryce-carson
When the user enters
The app crashes with this error
Warning: Error in sprintf: invalid format '%d'; use format %f, %e, %g or %a for numeric objects 101: sprintf 97: renderUI [C:\Users\ashok\Desktop\CougarStatsApp\CougarStats\R\statInfr.R#4757] 96: func 83: renderFunc 82: output$si-oneSDCI 1: shiny::runApp
If you look at inference for one population mean (mu) you will notice there is an extra layer of instant validation on non-integer sample size entries.
@bryce-carson
When the user enters
The app crashes with this error
Warning: Error in sprintf: invalid format '%d'; use format %f, %e, %g or %a for numeric objects 101: sprintf 97: renderUI [C:\Users\ashok\Desktop\CougarStatsApp\CougarStats\R\statInfr.R#4757] 96: func 83: renderFunc 82: output$si-oneSDCI 1: shiny::runApp
If you look at inference for one population mean (mu) you will notice there is an extra layer of instant validation on non-integer sample size entries.
Thanks, I will get that done tomorrow morning.
@samantha-v-brian
When the user selects
Currently there are two parameters of interest to choose from
I would like to add another parameter of interest to this list and make it look like this
It can be achieved by the following code
Now suppose the user selects
We should have two numericInputs called
Sample Size (n) Population Standard Deviation (σ)
Validate the above two fields:
Next we will have a radio button toggle as follows
In the user selects Confidence Interval then display the following Confidence Level choices
In the user selects Hypothesis Testing then display the following
Followed by a numericInput for
Hypothesized Population Mean (σ0) Value
Following that have this