confidence-interval

Determining High Density Region for a distribution in R

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 04:13:08
问题 Background: Normally, R gives quantiles for well-known distributions. Out of these quantiles, the lower 2.5% up to the upper 97.5% covers 95% of the area under these distributions. Question: Suppose I have a F distribution (df1 = 10, df2 = 90). In R, how can I determine the 95% of the area under this distribution such that this 95% only covers the HIGH DENSITY area, not the 95% that R normally gives (see my R code Below )? Note: Clearly, the highest density is the "mode" (dashed line in the

How to compute confidence intervals and plot them on a bar plot

断了今生、忘了曾经 提交于 2019-12-23 20:04:56
问题 How can I plot a bar out of a data = 1x10 cell , where each value in the cell has a different dimension like 3x100, 3x40, 66x2 etc. My goal is to get a bar plot, where I would have 10 group of bars and in every group three bars for each of the values. On the bar, I want it to be shown the median of the values, and I want to calculate the confidence interval and show it additionally. On this example there are not group of bars, but my point is to show you how I want the confidence intervals

Python PCA plot using Hotelling's T2 for a confidence interval

我们两清 提交于 2019-12-22 08:14:32
问题 I am trying to apply PCA for Multi variant Analysis and plot the score plot for first two components with Hotelling T2 confidence ellipse in python. I was able to get the scatter plot and I want to add 95% confidence ellipse to the scatter plot. It would be great if anyone know how it can be done in python. Sample picture of expected output: 回答1: This was bugging me, so I adopted an answer from PCA and Hotelling's T^2 for confidence intervall in R in python (and using some source code from

Bootstrapped p-value for a correlation coefficient on R

陌路散爱 提交于 2019-12-21 22:39:25
问题 On R , I used the boostrap method to get a correlation coefficient estimation and the confidence intervals. To get the p-value, I thought, I can calculate the proportion of the confidence intervals which do not contain zero. But this is not the solution. How can I get the p-value in this case ? I am using cor.test to get the coefficient estimation. cor.test may also gives me the p-value from every test. But how can I get the bootstrapped p-value ? Thank you very much ! Below an example : n=30

Confidence intervals of loadings in principal components in R

坚强是说给别人听的谎言 提交于 2019-12-21 21:55:00
问题 I am using following code for principal component analysis of first 4 columns of iris data set using prcomp function in R: > prcomp(iris[1:4]) Standard deviations: [1] 2.0562689 0.4926162 0.2796596 0.1543862 Rotation: PC1 PC2 PC3 PC4 Sepal.Length 0.36138659 -0.65658877 0.58202985 0.3154872 Sepal.Width -0.08452251 -0.73016143 -0.59791083 -0.3197231 Petal.Length 0.85667061 0.17337266 -0.07623608 -0.4798390 Petal.Width 0.35828920 0.07548102 -0.54583143 0.7536574 How can I get confidence

Gnuplot: linespoint with confidence interval

萝らか妹 提交于 2019-12-21 19:25:56
问题 I've following data: I want to plot a graph shows for all x the mean connected with lines (linespoint) and also showing all the confidence interval [ci_lower, ci_upper]. I managed to do that using 2 plots. set xrange [0:1100000] set yrange [0:5000] plot \ '2011-06-16_1n_result.txt' using 1:7 title '1 node' with lines, \ '2011-06-16_1n_result.txt' using 1:7:10:11 notitle with errorbars However it doesn't look nice with two colors and I have the feeling that there should be a way to do that

R proportion confidence interval factor

一曲冷凌霜 提交于 2019-12-21 16:51:46
问题 I am trying to summarise data from a household survey and as such most of my data is categorical (factor) data. I was looking to summarise it with plots of frequencies of responses to certain questions (e.g., a bar plot of percentages of households answering certain questions, with error bars showing confidence intervals). I found this excellent tutorial which I had thought was the answer to my prayers (http://www.cookbook-r.com/Manipulating_data/Summarizing_data/) but turns out this is only

cross-correlation using ccf in R [closed]

非 Y 不嫁゛ 提交于 2019-12-19 11:48:20
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I wanted to use ccf in R to compute the cross-correlation on two sets of time-series data. My question is how can I know if any of the correlation coefficients in the plot falls outside the dash blue lines

How can I use pre bootstrapped data to obtain a BCa confidence interval?

非 Y 不嫁゛ 提交于 2019-12-19 11:21:55
问题 I have bootstrapped two variables (one which is already in the "Impala.csv" file) using a function which resamples and reports the mean for a sample the size of nrow(data) for 5000 repetitions. The code is as follows: data<-read.csv("Impala.csv") allo<-data$distance data2<-read.csv("2010 - IM.csv") pro<-data2$pro n1<-nrow(data2) boot4000 <- c() for(i in 1:5000){ s <- sample(data2$xs,n1,replace=T,prob = data2$pro) boot4000[i] <- mean(s) }` and then combine the two outputs in a formula, giving

How do I plot confidence intervals in MATLAB?

心已入冬 提交于 2019-12-19 09:49:27
问题 I want to plot some confidence interval graphs in MATLAB but I don't have any idea at all how to do it. I have the data in a .xls file. Can someone give me a hint, or does anyone know commands for plotting CIs? 回答1: I'm not sure what you meant by confidence intervals graph, but this is an example of how to plot a two-sided 95% CI of a normal distribution: alpha = 0.05; % significance level mu = 10; % mean sigma = 2; % std cutoff1 = norminv(alpha, mu, sigma); cutoff2 = norminv(1-alpha, mu,