similar to: Fwd: Strange results : bootrstrp CIs

Displaying 20 results from an estimated 1000 matches similar to: "Fwd: Strange results : bootrstrp CIs"

2024 Jan 14
1
Fwd: Strange results : bootrstrp CIs
On Sat, 13 Jan 2024 17:59:16 -0500 Duncan Murdoch <murdoch.duncan at gmail.com> wrote: <SNIP> > My guess is that one of the bootstrap samples had a different > selection of countries, so factor(Country) had different levels, and > that would really mess things up. > > You'll need to decide how to handle that: If you are trying to > estimate the coefficient for
2024 Jan 14
1
Fwd: Strange results : bootrstrp CIs
On 13/01/2024 8:58 p.m., Rolf Turner wrote: > On Sat, 13 Jan 2024 17:59:16 -0500 > Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > <SNIP> > >> My guess is that one of the bootstrap samples had a different >> selection of countries, so factor(Country) had different levels, and >> that would really mess things up. >> >> You'll
2024 Jan 13
1
Strange results : bootrstrp CIs
It took me a little while to figure this out, but: the problem is that if your resampling leaves out any countries (which is very likely), your model applied to the bootstrapped data will have fewer coefficients than your original model. I tried this: cc <- unique(e$Country) func <- function(data, idx) { coef(lm(Score~ Time + factor(Country, levels =cc),data=data[idx,])) } but lm()
2024 Jan 14
1
Strange results : bootrstrp CIs
Well, this would seem to work: e <- data.frame(Score = Score , Country = factor(Country) , Time = Time) ncountry <- nlevels(e$Country) func= function(dat,idx) { if(length(unique(dat[idx,'Country'])) < ncountry) NA else coef(lm(Score~ Time + Country,data = dat[idx,])) } B <- boot(e, func, R=1000) boot.ci(B, index=2, type="perc")
2024 Jan 13
1
Strange results : bootrstrp CIs
Dear Duncan, Dear Ivan, I really thank you a lot for your response. So, if I correctly understand your answers the problem is coming from this line: coef(lm(Score~ Time + factor(Country)),data=data[idx,]) This line should be: coef(lm(Score~ Time + factor(Country),data=data[idx,])) If yes, now I get an error message (code here below)! So, it still does not work. Error in t.star[r, ] <-
2024 Jan 13
1
Strange results : bootrstrp CIs
? Sat, 13 Jan 2024 20:33:47 +0000 (UTC) varin sacha via R-help <r-help at r-project.org> ?????: > coef(lm(Score~ Time + factor(Country)),data=data[idx,]) Wrong place for the data=... argument. You meant to give it to lm(...), but in the end it went to coef(...). Without the data=... argument, the formula passed to lm() picks up the global variables inherited by the func() closure.
2024 Jan 13
2
Strange results : bootrstrp CIs
Dear R-experts, Here below, my R code working BUT I get a strange result I was not expecting! Indeed, the?95% percentile bootstrap CIs is (-54.81, -54.81 ). Is anything going wrong? Best, ########################################## Score=c(345,564,467,675,432,346,476,512,567,543,234,435,654,411,356,658,432,345,432,345, 345,456,543,501) ? Country=c("Italy", "Italy",
2023 Dec 14
0
R-help Digest, Vol 250, Issue 13
Kevin, Maybe also look at what air quality monitoring is being done in area. https://cran.r-project.org/web/packages/RAQSAPI/vignettes/RAQSAPIvignette.html Depends what and how near, but might be something relevant there? Karl Dr Karl Ropkins Transport Studies | Environment | University of Leeds ------------------------------ Message: 2 Date: Tue, 12 Dec 2023 07:52:59 -0800 From: Bert Gunter
2018 Apr 07
0
Fast tau-estimator line does not appear on the plot
You need to pay attention to the documentation more closely. If you don't know what something means, that is usually a signal that you need to study more... in this case about the difference between an input variable and a design (model) matrix. This is a concept from the standard linear algebra formulation for regression equations. (Note that I have never used RobPer, nor do I regularly
2023 Feb 16
1
GAM with binary predictors
Dear Sacha, use glm() in this case. I'd rather code the covariable as TRUE / FALSE or as a factor. Best regards, ir. Thierry Onkelinx Statisticus / Statistician Vlaamse Overheid / Government of Flanders INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance thierry.onkelinx at inbo.be
2017 Dec 10
0
Confidence intervals around the MIC (Maximal information coefficient)
You need: myCor <- function(data, index){ mine(data[index, ])$MIC[1, 2] } results=boot(data = cbind(C,D), statistic = myCor, R = 2000) boot.ci(results,type="all") Look at the differences between: mine(C, D) and mine(cbind(C, D)) The first returns a value, the second returns a symmetric matrix. Just like cor() David L. Carlson Department of Anthropology Texas A&M
2018 Apr 06
1
Fast tau-estimator line does not appear on the plot
R-experts, I have fitted many different lines. The fast-tau estimator (yellow line) seems strange to me?because this yellow line is not at all in agreement with the other lines (reverse slope, I mean the yellow line has a positive slope and the other ones have negative slope). Is there something wrong in my R code ? Is it because the Y variable is 1 vector and should be a matrix ? Here is the
2017 Oct 22
0
Add a vertical line and some values on a plot
Hello, After the plot just do abline(v = median(A)) As for how to plot points, see, well, ?points(). Hope this helps, Rui Barradas Em 22-10-2017 16:33, varin sacha via R-help escreveu: > Dear R-experts, > > Here below is my code, > I would like to add a vertical line on my plot, showing the median and I would like to place some values on this graph as well, i.e. 4.3 and -8.4. How
2016 Apr 04
1
Test for Homoscedesticity in R Without BP Test
On Mon, 4 Apr 2016, varin sacha via R-help wrote: > Hi Deepak, > > In econometrics there is another test very often used : the white test. > The white test is based on the comparison of the estimated variances of > residuals when the model is estimated by OLS under the assumption of > homoscedasticity and when the model is estimated by OLS under the > assumption of
2020 Oct 27
0
How to correct my error message
Hi, a is of length 60. b is of length 60. z is of length 57. What do you expect to have happen when you create y_model ? What happens to those other 3 observations? Sarah On Tue, Oct 27, 2020 at 3:07 PM varin sacha via R-help <r-help at r-project.org> wrote: > > Dear R-experts, > > Here below my R code. The warning message is not a problem to me but there is an error message
2018 Mar 29
1
can not install package "matie"
Varin In the teaching you to fish department, you can find those dependencies Duncan appeared to pull out of thin air by looking at the CRAN contributed packages web pages, which can easily be found with Google. Start at the matie page and follow the dependency links and look at dependencies. In particular the error message mentioning the proxy package is a clue that dependencies might be a
2018 May 08
0
Average of results coming from B=100 repetitions (looping)
On 5/8/2018 12:26 PM, varin sacha via R-help wrote: > > Dear R-experts, > > Here below the reproducible example. I am trying to get the average of the 100 results coming from the "lst" function. I have tried lst$mean and mean(lst). It does not work. > Any help would be highly appreciated > > #################### > > ?## R script for getting MedAe and
2023 Oct 24
1
running crossvalidation many times MSE for Lasso regression
?s 20:12 de 23/10/2023, varin sacha via R-help escreveu: > Dear R-experts, > > I really thank you all a lot for your responses. So, here is the error (and warning) messages at the end of my R code. > > Many thanks for your help. > > > Error in UseMethod("predict") : > ? no applicable method for 'predict' applied to an object of class
2018 May 22
0
Bootstrap and average median squared error
Hello, If you want to bootstrap a statistic, I suggest you use base package boot. You would need the data in a data.frame, see how you could do it. library(boot) bootMedianSE <- function(data, indices){ d <- data[indices, ] fit <- rq(crp ~ bmi + glucose, tau = 0.5, data = d) ypred <- predict(fit) y <- d$crp median(y - ypred)^2 } dat <-
2023 Oct 22
2
running crossvalidation many times MSE for Lasso regression
No error message shown Please include the error message so that it is not necessary to rerun your code. This might enable someone to see the problem without running the code (e.g. downloading packages, etc.) -- Bert On Sun, Oct 22, 2023 at 1:36?PM varin sacha via R-help <r-help at r-project.org> wrote: > > Dear R-experts, > > Here below my R code with an error message. Can