[R] GAM with binary predictors

2023-02-11 Thread varin sacha via R-help
Dear R-experts, I am trying to fit a GAM with 2 binary predictors (variables coded 0,1). I guess I cannot just smooth binary variables. By the way I code them as 0=no,1=yes, then mgcv will think those variables are numeric.  I have tried to change 0 and 1 in no and yes. It does not work. How to

[R] Problem of intercept?

2023-02-21 Thread varin sacha via R-help
Dear R-experts, Here below my R code working with quite a few warnings.  x11 and x12 are dichotomous variable (0=no and 1=yes). I substract 1 to ignore intercept. I would like not to ignore intercept. How to modify my R code because if I just remove -1 it does not work? y= c(32,45,65,34,23,43,

Re: [R] GAM with binary predictors

2023-02-21 Thread varin sacha via R-help
11 feb. 2023 om 18:35 schreef varin sacha via R-help : > Dear R-experts, > > I am trying to fit a GAM with 2 binary predictors (variables coded 0,1). I > guess I cannot just smooth binary variables. By the way I code them as > 0=no,1=yes, then mgcv will think those variables are

Re: [R] Problem of intercept?

2023-02-22 Thread varin sacha via R-help
> On 21 Feb 2023, at 22:33 , varin sacha via R-help > wrote: > > Dear R-experts, > > Here below my R code working with quite a few warnings. > x11 and x12 are dichotomous variable (0=no and 1=yes). I substract 1 to > ignore intercept. > I would like not to ignore i

[R] Get the graph of CAM (Causal additive model)?

2023-03-18 Thread varin sacha via R-help
Dear R-experts, Here below my R code working but I would like to plot (get the graph) of the Causal additive model exactly the same way I get the graph (CPDAG) from the bnlearn R package. Is it possible? If yes, how? Many thanks ### # libraries library(devtools)

[R] problem installing RGBL library

2023-04-22 Thread varin sacha via R-help
Dear R-experts, How to solve that problem? My R version is 4.2.1 Here below trying to install RGBL library found here :  https://bioconductor.org/packages/release/bioc/html/RBGL.html So, I run this R code : if (!require("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocM

Re: [R] problem installing RGBL library

2023-04-22 Thread varin sacha via R-help
’ The following objects are masked from ‘package:igraph’:   bfs, dfs, transitivity Le samedi 22 avril 2023 à 18:12:56 UTC+2, Eric Berger a écrit : What happens with the command > library(RBGL) On Sat, Apr 22, 2023 at 7:08 PM varin sacha via R-help wrote: > Dear R-e

Re: [R] problem installing RGBL library

2023-04-22 Thread varin sacha via R-help
>   degree, edges, intersection > > > Attaching package: ‘RBGL’ > > The following objects are masked from ‘package:igraph’: > >   bfs, dfs, transitivity > > > > > > > > > > > Le samedi 22 avril 2023 à 18:12:56 UTC+2, Eric Berger > a écrit :

Re: [R] problem installing RGBL library

2023-04-22 Thread varin sacha via R-help
Bert, Thanks ! It works ! Best, Le samedi 22 avril 2023 à 19:42:18 UTC+2, Bert Gunter a écrit : Is lvida.R in your working directory? Try using the full path name to the file instead in source() -- Bert On Sat, Apr 22, 2023 at 9:38 AM varin sacha via R-help wrote: > &g

[R] problem installing RUcausal library

2023-04-22 Thread varin sacha via R-help
Me again ! How to solve this? At the end of this page there is the installation command : https://gitlab.science.ru.nl/gbucur/RUcausal/-/blob/master/README.Rmd Working with a MAC, I have tried to install the RUcausal library (copy and paste the installation command). It is written that the pack

[R] Bias and variance tradeoff

2023-04-26 Thread varin sacha via R-help
Dear R-experts, Here below a toy example to calculate the MSE (mean squared error).  Starting from this equation : MSE = bias^2 + variance + irreducible error I am trying to get the bias and the variance in addition to the MSE. How to get them both? Many thanks for your help. ###

[R] NaN response with gam (mgcv library)

2023-04-30 Thread varin sacha via R-help
Dear R-experts, Here below my R code. I get a NaN response for gam with mgcv library. How to solve that problem? Many thanks. # library(mgcv)   y=c(23,24,34,40,42,43,54,34,52,54,23,32,35,45,46,54,34,36,37,48) x1=c(0.1,0.3,0.5,0.7,0.8,0.9,0.

Re: [R] NaN response with gam (mgcv library)

2023-05-01 Thread varin sacha via R-help
Dear Simon, Thanks ! It works ! Best, Le lundi 1 mai 2023 à 11:19:26 UTC+2, Simon Wood a écrit : try... sum(residuals(model1)^2) On 30/04/2023 22:03, varin sacha via R-help wrote: > Dear R-experts, > > Here below my R code. I get a NaN response for gam with mgcv librar

[R] 2 bands (confidence and prediction) on the same GAM plot?

2023-05-01 Thread varin sacha via R-help
Dear R-experts, Here below my R code (toy example) working! The only thing missing is in my GAM plot: I would like to get on the same graph the 2 bands (prediction and confidence bands) like in my lm model graph! Is it possible? How to get that?

[R] Nested structure data simulation

2019-05-18 Thread varin sacha via R-help
Dear R-Experts, In a data simulation, I would like a balanced distribution with a nested structure for classroom and teacher (not for school). I mean 50 pupils belonging to C1, 50 other pupils belonging to C2, 50 other pupils belonging to C3 and so on. Then I want the 50 pupils belonging to C1

Re: [R] Nested structure data simulation

2019-05-18 Thread varin sacha via R-help
","C2","C3","C4","C5","C6"), 50) # make a character vector, with 50 "C1", 50 "C2", ... classroom <- tmp[sample(1:300)] # make a random permutation. Certainly you may also make it into one line: classroom <- rep(c("C

Re: [R] Nested structure data simulation

2019-05-18 Thread varin sacha via R-help
quot;c", 1:5, sep=""), sep = ".")) } pupils <- character() for (class in classes) {   pupils <- c(pupils, paste(class, paste("p", 1:10, sep=""), sep = ".")) } B. > On 2019-05-18, at 09:57, varin sacha via R-help wrote: > &

Re: [R] Nested structure data simulation

2019-05-19 Thread varin sacha via R-help
, May 18, 2019 at 10:04 PM varin sacha via R-help wrote: > > Dear Boris, > > Yes, top-down, no problem. Many thanks, but in your code did you not forget > "teacher" ? As a reminder teacher has to be nested with classes. I mean the > 50 pupils belonging to C1 must be

Re: [R] Nested structure data simulation

2019-05-19 Thread varin sacha via R-help
on of > what exactly you want. > > I assume the situation is that you know what a data structure you > want, but do not know > how to conveniently create such structure. > And that is where others can help you. > So, please, describe the wanted data structure more thoroughly, >

[R] Fitdistrplus package : Error messages

2019-05-29 Thread varin sacha via R-help
Dear R-Experts, Here is a toy example, reproducible example, I get error messages. I have tried to fix it by myself using "google is my friend", but I did not get it. If somebody can help me to fix these errors, would be highly appreciated. ## install.packages("fitdistrp

Re: [R] Fitdistrplus package : Error messages

2019-06-02 Thread varin sacha via R-help
ist(floor(x), "pois") plot(f2p) summary(f2p) Not so well ##negative binomial distribution f2n <- fitdist(floor(x), "nbinom") f2n <- fitdist(ceiling(x), "nbinom") f2n <- fitdist(round(x), "nbinom") plot(f2n) summary(f2n) Hope this helps, Rui Ba

[R] Simulations of GAM and MARS models : sample size ; Y-outliers and missing X-data

2019-08-07 Thread varin sacha via R-help
Dear Experts, I have fitted MARS and GAM models on a real dataset. My goal is prediction. I have run crossvalidation many times to get an idea of the out-of-bag accuracy value. I use the Mean Squared Error (MSE) as an error evaluation criterion. I have published my paper and the reviewers ask m

Re: [R] Simulations of GAM and MARS models : sample size ; Y-outliers and missing X-data

2019-08-08 Thread varin sacha via R-help
Dear Abby, Many thanks for your response. To answer your question. For me better all the x variables (collectively), to have m% missing values. When you tell me : "Modify your code so that a single function say sim.test() computes your simulated statistics, for n sample size and m missing valu

[R] Not the same length

2019-09-17 Thread varin sacha via R-help
Dear R-helpers, Doing dput(x) and dput(y_obs), the 2 vectors are not the same length (1800 for y_obs and 2000 for x) How can I solve the problem ?  Here is the reproducible R code   #  #  #  #  #  #  #  #  #  # library(mgcv) library(earth) n<-2000 x<-runif(n, 0, 5)   y_model<- 0.1*x^3 -

Re: [R] Not the same length

2019-09-17 Thread varin sacha via R-help
)^2) MSE_MARS<-mean((mars_model$fitted.values - y_model)^2)   MSE_GAM MSE_MARS Le mardi 17 septembre 2019 à 22:27:54 UTC+2, David Winsemius a écrit : On 9/17/19 12:48 PM, varin sacha via R-help wrote: > Dear R-helpers, > > Doing dput(x) and dput(y_obs), the 2 vectors are not

Re: [R] Not the same length

2019-09-17 Thread varin sacha via R-help
obs <- c( rnorm(n*0.9, y_model, 0.1), rnorm(n*0.1, y_model, 0.5) ) then y_obs:   > length(y_obs) [1] 2000     De: varin sacha via R-help Enviado: martes, 17 de septiembre de 2019 21:49 Para: R-help Mailing List Asunto: [R] Not the same length   Dear R-helpers,   Doing dput(x) and dput(y_ob

Re: [R] Not the same length

2019-09-18 Thread varin sacha via R-help
s <- y_model + c(rnorm(0.9 * n, 0, 0.1), rnorm(0.1 * n, 0, 0.5)) or y_obs <- rnorm(n, y_model, rep(c(0.1, 0.5), c(.9 * n, .1 * n))) -pd > On 17 Sep 2019, at 22:27 , David Winsemius wrote: > > > On 9/17/19 12:48 PM, varin sacha via R-help wrote: >> Dear R-helpers, >>

Re: [R] Not the same length

2019-09-18 Thread varin sacha via R-help
Ar ! What a pity, I have not seen it ! Many thanks ! Le mercredi 18 septembre 2019 à 19:07:42 UTC+2, peter dalgaard a écrit : Redefining n is probably not a good idea... [...snip...] > m <-runif(n, 0, 5) > n <-rnorm(n, 2, 3) Oops! n is now a vector of length 2000. [...snip...] >

[R] 95% bootstrap CIs

2019-09-23 Thread varin sacha via R-help
Dear R-Experts, Here is my reproducible R code to get the Mean squared error of GAM and MARS after I = 50 iterations/replications. If I want to get the 95% bootstrap CIs around the MSE of GAM and around the MSE of MARS, how can I complete/modify my R code ? Many thanks for your precious help.

Re: [R] 95% bootstrap CIs

2019-09-25 Thread varin sacha via R-help
ootResults <-boot(data=data,statistic=mse,R=1000) ##   Le lundi 23 septembre 2019 à 21:42:56 UTC+2, varin sacha via R-help a écrit : Dear R-Experts, Here is my reproducible R code to get the Mean squared error of GAM and MARS after I =

Re: [R] 95% bootstrap CIs

2019-09-26 Thread varin sacha via R-help
type) mse <- function(data,i) {   boot.earth <- earth((y_obs~x+z+a),data=data[i,])   mean(boot.earth$residuals^2) } bootResults <- boot(data=data, statistic=mse, R=1000) boot.ci(bootResults, type = boot.ci.type) Hope this helps, Rui Barradas Às 13:43 de 25/09/19, varin sacha via R-help es

[R] Simulations study not working entirely...

2019-10-21 Thread varin sacha via R-help
Dear R-Experts, Here below my reproducible example working but not entirely (working). What I understand is that there is a problem of libraries library(hbrfit) and ... ? How can I make it work entirely, many thanks for your precious help. SIMULATION STUDY 3 variables with 10% outliers

Re: [R] Simulations study not working entirely...

2019-10-21 Thread varin sacha via R-help
1] hbrfit_0.02       Rfit_0.23.0       RobStatTM_1.0.1   fit.models_0.5-14  [5] RobPer_1.2.2      rgenoud_5.8-3.0   BB_2019.10-1      quantreg_5.51      [9] SparseM_1.77      MASS_7.3-51.4     robustbase_0.93-5 ``` There is no error or warning, except that  MSE_fastTau is an NaN. What problem  are you l

Re: [R] Simulations study not working entirely...

2019-10-22 Thread varin sacha via R-help
Dear David, Dear Jiefei, Many thanks for your comments. I got it now. It works. Best, Sacha Le lundi 21 octobre 2019 à 22:00:39 UTC+2, David Winsemius a écrit : On 10/21/19 9:40 AM, varin sacha via R-help wrote: > Dear R-Experts, > > Here below my reproducible example wo

[R] Vector memory exhausted (limit reached?)

2019-10-28 Thread varin sacha via R-help
Dear R-experts, My reproducible example here below is not working because of an error message : Erreur : vecteurs de mémoire épuisés (limite atteinte ?) My code perfectly works when n=3000 or n=5000 but as soon as n=1 my code does not work anymore. By the way, my code takes a very long time

[R] RandomForest tuning the parameters

2023-05-08 Thread varin sacha via R-help
Dear R-experts, Here below a toy example with some error messages, especially at the end of the code (Tuning the parameters). Your help to correct my R code would be highly appreciated. ### #libraries library(lattice) library(ggplot2) library(caret) library(

Re: [R] RandomForest tuning the parameters

2023-05-13 Thread varin sacha via R-help
, May 9, 2023 at 6:40 AM Eric Berger wrote: > Hi, > One problem you have is with the command: > regr<-randomForest(y~x1+x2, data=X_train, proximity=TRUE) > > What you need is something like this: > > X2 <- cbind(X,y) > regr<-randomForest(y~x1+x2, data=X2, proxi

[R] Exact 95% CIs weibull distribution

2023-06-01 Thread varin sacha via R-help
R-experts, I am trying to find the exact 95% confidence intervals of the mean (and the median) for the weibull distribution. Here below I have the exact 95% CIs of the meanlog and the median for a lognormal using EnvStats library (ready-to-run function in library) but I don't find how to get th

[R] running crossvalidation many times MSE for Lasso regression

2023-10-22 Thread varin sacha via R-help
Dear R-experts, Here below my R code with an error message. Can somebody help me to fix this error?  Really appreciate your help. Best, # MSE CROSSVALIDATION Lasso regression  library(glmnet)   x1=c(34,35,12,13,15,37,65,45,47,67,87,

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-23 Thread varin sacha via R-help
o 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.) >      >> >      >> And it's not necessarily true

Re: [R] running crossvalidation many times MSE for Lasso regression

2023-10-24 Thread varin sacha via R-help
Dear Rui, I really thank you a lot for your response and your R code. Best, Sacha Le mardi 24 octobre 2023 à 16:37:56 UTC+2, Rui Barradas a écrit : À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.

[R] Plot for 10 years extrapolation

2023-10-26 Thread varin sacha via R-help
Dear R-Experts, Here below my R code working but I don't know how to complete/finish my R code to get the final plot with the extrapolation for the10 more years. Indeed, I try to extrapolate my data with a linear fit over the next 10 years. So I create a date sequence for the next 10 years and

Re: [R] Plot for 10 years extrapolation

2023-10-28 Thread varin sacha via R-help
Dear Rui, I really thank you a lot for your precious R help. It is exactly what I was trying to do! Once more, many thanks! Best, Sacha Le vendredi 27 octobre 2023 à 09:36:18 UTC+2, Rui Barradas a écrit : Às 19:23 de 26/10/2023, varin sacha via R-help escreveu: > Dear R-Expe

[R] Cannot calculate confidence intervals NULL

2023-11-15 Thread varin sacha via R-help
R-Experts, Here below my R code working without error message but I don't get the results I am expecting. Here is the result I get: [1] "All values of t are equal to 0.28611928397257 \n Cannot calculate confidence intervals" NULL If someone knows how to solve my problem, really appreciate. Bes

Re: [R] Cannot calculate confidence intervals NULL

2023-11-20 Thread varin sacha via R-help
y's are not looked for in data (i.e. NSE) but in the environment where the function was defined, which is standard evaluation. Change the above to: cor1 <- with(d, cor(x1, y1, method="spearman"))  cor2 <- with(d, cor(x2, y2, method="spearman")) and all should be fi

[R] ggplot2: Get the regression line with 95% confidence bands

2023-12-10 Thread varin sacha via R-help
Dear R-experts, Here below my R code, as my X-axis is "year", I must be missing one or more steps! I am trying to get the regression line with the 95% confidence bands around the regression line. Any help would be appreciated. Best, S. # library(g

Re: [R] ggplot2: Get the regression line with 95% confidence bands

2023-12-12 Thread varin sacha via R-help
; On 12/10/2023 2:50 PM, Rui Barradas wrote: >> Às 22:35 de 10/12/2023, varin sacha via R-help escreveu: >>> >>> Dear R-experts, >>> >>> Here below my R code, as my X-axis is "year", I must be missing one >>> or more steps! I am trying to

[R] Strange results : bootrstrp CIs

2024-01-13 Thread varin sacha via R-help
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

Re: [R] Strange results : bootrstrp CIs

2024-01-13 Thread varin sacha via R-help
Time)     library(boot) func= function(data, idx) { coef(lm(Score~ Time + factor(Country),data=data[idx,])) } B= boot(e, func, R=1000)   boot.ci(B, index=2, type="perc") # Le samedi 13 janvier 2024 à 21:56:58 UTC+1, Ivan Kr

Re: [R] Fwd: Strange results : bootrstrp CIs

2024-01-14 Thread varin sacha via R-help
Dear R-experts, I really thank you all for your responses. Best, Le dimanche 14 janvier 2024 à 10:22:12 UTC+1, Duncan Murdoch a écrit : On 13/01/2024 8:58 p.m., Rolf Turner wrote: > On Sat, 13 Jan 2024 17:59:16 -0500 > Duncan Murdoch wrote: > > > >> My guess is that one of the boot

[R] Plotting extrapolation with R like AUTOBOX does

2024-01-14 Thread varin sacha via R-help
Dear R-experts, I write to you to know if somebody is aware of a R package (or function) able to plot graphs for extrapolation. I need to be clear on what extrapolation really is to me. It is when we use the model for X variables outside the range of X variables that were used to construct the

[R] Code seems OK (no warnings, no error messages) but no results

2020-03-16 Thread varin sacha via R-help
Good afternoon, Here below my reproducible R code. I don't get any results. I am looking for MSE_fastMM value and the bootstrap CIs around MSE_fastMM value. How can I finish/correct my R code to get the results ? Many thanks for your help. install.packages( "robustbase",dep

Re: [R] Code seems OK (no warnings, no error messages) but no results

2020-03-18 Thread varin sacha via R-help
t.MM <- lmrob(y_obs~b+z+a,data=data[i,])   mean(boot.MM$residuals^2) } bootResults_MM <-boot(data=data, statistic=MSE_fastMM, R=100) boot.ci(bootResults_MM, type = boot.ci.type) } Le mercredi 18 mars 2020 à 09:44:19 UTC+1, peter dalgaard a écrit : The double

[R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
Dear R-experts, Here below my R code giving an error message that I don't understand. If somebody can help me to fix it, it would be highly appreciated. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "robustbase",dependencies=TRUE ) install.packages( "boot",dependencies=TRUE )

Re: [R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
AM, varin sacha via R-help wrote: > Dear R-experts, > > Here below my R code giving an error message that I don't understand. If > somebody can help me to fix it, it would be highly appreciated. > > # # # # # # # # # # # # # # # # # # # # # # # # > install.pack

Re: [R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
Hi David, Perfect I got it now. One last precision, if I want to get the MSE value how can I get it ? Le samedi 21 mars 2020 à 20:26:37 UTC+1, David Winsemius a écrit : On 3/21/20 12:18 PM, varin sacha wrote: >   mean((d[["y_obs "]] - ypred)^2) __

Re: [R] Strange error message, many thanks

2020-03-21 Thread varin sacha via R-help
David, Great... exactly what I was looking for... Many thanks. Le samedi 21 mars 2020 à 21:12:31 UTC+1, David Winsemius a écrit : On 3/21/20 12:56 PM, varin sacha wrote: > Hi David, > > Perfect I got it now. One last precision, if I want to get the MSE value how > can I get it ? If

[R] No predict method for hbrfit

2020-03-21 Thread varin sacha via R-help
Dear R-helpers, Using the HBR (high breakdown rank-based) robust estimator and the hbrfit function, I get an error saying Error in UseMethod("predict") for hbrfit. How can I solve the problem ? Many thanks for your help. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "robustb

[R] Error in FastTau(formula, data = d) : unused argument(s) (data = d)

2020-03-21 Thread varin sacha via R-help
Dear R-helpers, Another problem with FastTau function from the RobPer packages. Any solution to solve my problem would be highly appreciated. # # # # # # # # # # # # # # # # # # # # # # # # install.packages( "boot",dependencies=TRUE ) install.packages( "RobPer",dependencies=TRUE  ) library(boo

Re: [R] No predict method for hbrfit

2020-03-22 Thread varin sacha via R-help
e results reproducible  set.seed(1234)   # bootstrapping with 60 replications  results <- boot(data = df, statistic = MSE,       R = 60, formula = y_obs ~ b+z+a) str(results) boot.ci(results, type="bca" ) # # # # # # # # # # # # # # # # # # # # # # # #   Le dimanche 22 m

Re: [R] Error in FastTau(formula, data = d) : unused argument(s) (data = d)

2020-03-22 Thread varin sacha via R-help
= MSE, >          R = 10, formula = ~b+z+a) > > type <- c("norm","basic", "stud", "perc", "bca") > boot.ci(results, type = type[-5]) > > > Hope this helps, > > Rui Barradas > > Às 23:14 de 21/

[R] Same results but different functions ?

2020-03-23 Thread varin sacha via R-help
Dear R-experts, The rlm command in the MASS package command implements several versions of robust regression, for example the Huber and the Tukey (bisquare weighting function) estimators. In my R code here below I try to get the Tukey (bisquare weighting function) estimation, R gives me an erro

Re: [R] Same results but different functions ?

2020-03-26 Thread varin sacha via R-help
n fantastic when it was introduced (into S / S-plus, before R existed [in a publicly visible way]) but it had been based of what was available back then, end of the 80's, beginning 90's. Martin     > On 23/03/2020 12:39, varin sacha via R-help wrote:     >> Dear R-expert

[R] Error message using boot.ci function

2020-03-28 Thread varin sacha via R-help
Dear R-experts, Here below my "toy" reproducible example showing many warnings and an error message. What I am interested in is the error message. Of course I can access and view the results doing : summary(results$t) to give me an idea of what is going on. But I don't know how to correct/solve

Re: [R] Error message using boot.ci function

2020-03-30 Thread varin sacha via R-help
s) boot.ci(results, type="norm" ) str(Dataset) str(newdata) summary(results$t) # # # # # # # # # # # # # # # # # # # # # # # # # Le lundi 30 mars 2020 à 00:40:33 UTC+2, David Winsemius a écrit : On 3/28/20 12:25 PM, varin sacha via R-help wrote: > Dear R-experts, > > Here below my

Re: [R] Error message using boot.ci function

2020-03-30 Thread varin sacha via R-help
R = 100, formula = crp ~ bmi+glucose+age+sex,method="MM") > > str(results) > boot.ci(results, type="norm" ) > > str(Dataset) > str(newdata) > summary(results$t) > # # # # # # # # # # # # # # # # # # # # # # # # # > > > > > >

[R] Error in robdist.hbrfit(x) : x is probably collinear

2020-03-30 Thread varin sacha via R-help
Hi, A google search does not give me any hint :=( Maybe somebody can help me to fix the error message I get : Error in robdist.hbrfit(x) : x is probably collinear # # # # # # # # # # # # # # # # # # # ## # # # # # # # # # # # # # # bmi=c(23,43,21,23,45,65,45,11,12,13,23,34,NA,NA,34,35,45,65,43

Re: [R] Error in robdist.hbrfit(x) : x is probably collinear

2020-03-30 Thread varin sacha via R-help
coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Mon, Mar 30, 2020 at 12:10 PM varin sacha via R-help wrote: > > Hi, > > A google search does not give me any hint :=( > Maybe somebody can help me to fix

[R] Add Gauss normal curve ?

2020-04-11 Thread varin sacha via R-help
Dear R-experts, Here below my reproducible example. I would like to fit/add the Gauss normal curve to this data. I don't get it. There is no error message but I don't get what I am looking for. Many thanks for your help. mydates <-

Re: [R] Add Gauss normal curve ?

2020-04-11 Thread varin sacha via R-help
gaard a écrit : Two obvious problems: 1. mean(nc) is a count, not a date, sd likewise 2. the scale of dnorm() is density, not count So (slightly inefficient, but who cares...): y <- rep(mydates, nc) n <- sum(nc) curve(n*dnorm(x, mean(y), sd(y)), add=TRUE, col="

[R] Span for loess regression

2020-04-14 Thread varin sacha via R-help
Dear R-experts, I am trying to find the best span for my loess regression. Here below a reproducible example. I don't get the result. Am I missing something ? Many thanks for your help. a<-c(2,3,4,3,2,6,5,7,4,5,12,13,21,6,4,5,6,7) b<-

Re: [R] Span for loess regression

2020-04-15 Thread varin sacha via R-help
Dear Ivan, Many thanks I got it now. Best, Le mercredi 15 avril 2020 à 09:49:26 UTC+2, Ivan Krylov a écrit : On Tue, 14 Apr 2020 21:00:34 + (UTC) varin sacha via R-help wrote: > Here below a reproducible example. I don't get the result. Thanks for providing a conci

[R] Add GAM fit on the plot ?

2020-04-22 Thread varin sacha via R-help
Dear R-experts, Here below the reproducible example. I can not add the "green" gam curve on the plot. The last line of my R code gives me problem. There is a message error that I don't understand. Many thanks for your precious help. ### a <- a

Re: [R] Add GAM fit on the plot ?

2020-04-23 Thread varin sacha via R-help
David, Rui, Many thanks for your response. Thanks Rui it perfectly works. Best, Le jeudi 23 avril 2020 à 06:18:46 UTC+2, Rui Barradas a écrit : Hello, Inline. Às 23:29 de 22/04/20, varin sacha via R-help escreveu: > Dear R-experts, > > Here below the reproducible e

[R] Fit Gaussian curve on my data ?

2020-04-25 Thread varin sacha via R-help
Dear R-experts, I am trying to fit a gaussian density curve. More precisely, I would like to obtain the fitted "Gaussian curve". "m" is the gaussian mean, "sd" is the standard deviation and "k" is an arbitrary scaling parameter (since the gaussian density is constrained to integrate to 1, wher

Re: [R] Fit Gaussian curve on my data ?

2020-04-27 Thread varin sacha via R-help
till could be a function representing a probability distribution... On Sun, Apr 26, 2020 at 7:09 AM varin sacha via R-help wrote: > > Dear R-experts, > > I am trying to fit a gaussian density curve. More precisely, I would like to > obtain the fitted "Gaussian curve".

[R] Replication : How to get only 1 value

2020-05-07 Thread varin sacha via R-help
Dear R-experts, My goal is to get only 1 value : the average/ the mean of the 100 MSE values. How can I finish my R code ? ### my.experiment <- function()  { n<-500 x<-runif(n, 0, 5) z <- rnorm(n, 2, 3) a <- runif(n, 0, 5) y_mode

[R] Get a result but an error message as well ?

2020-05-19 Thread varin sacha via R-help
Dear R-experts, Here is my R code, I get a result but I also get an error message so I doubt I can trust the result I get. What is going wrong ? Many thanks. a<-c(2,4,3,4,6,5,3,1,2,3,4,3,4,5,65) b<-c(23,45,32,12,23,43,56,44,33,11,12,54,23,34,54) d<-c(9,4

Re: [R] [External] Get a result but an error message as well ?

2020-05-19 Thread varin sacha via R-help
0 On Tue, May 19, 2020 at 3:51 PM varin sacha via R-help wrote: > Dear R-experts, > > Here is my R code, I get a result but I also get an error message so I doubt > I can trust the result I get. > What is going wrong ? Many thanks. > >

Re: [R] [External] Get a result but an error message as well ?

2020-05-19 Thread varin sacha via R-help
C+2, Rui Barradas a écrit : Hello, Inline. Às 21:38 de 19/05/20, varin sacha via R-help escreveu: > > Hi Richard, > > Thanks for your response. > However, how can I correct my R code knowing that I want, as a result, only > one value : the mean of the 500 MSE_OLS values ?

Re: [R] [External] Get a result but an error message as well ?

2020-05-27 Thread varin sacha via R-help
ent <- function() { > > OLS <- lm( a ~ b+d ) > > MSE_OLS<-mean(OLS$residuals^2) > > return( c(MSE_OLS) ) > } > > my.data = replicate( 500, my.experiment() ) > colnames(my.data) <- c("MSE_OLS") > mean(my.data) > ###########

[R] Permutation Ramsey RESET test ?

2020-06-28 Thread varin sacha via R-help
Dear R-experts, I am trying to do a permutation test for the Ramsey RESET test. More precisely, I am interested in the "exact" p-value of the test. I have checked the coin package and all the functions (oneway_test; ...). There are plenty of functions but no one is helping me for RESET test. I

[R] Double MAD with R

2020-08-03 Thread varin sacha via R-help
Dear R-Experts, Is there an all-ready function to calculate the Double MAD (Median absolute deviation) as there is an easy function to calculate the MAD "mad function". Or I have to write my own function for Double MAD ? To calculate the double MAD, the idea is the following : for the obtained

Re: [R] Double MAD with R

2020-08-04 Thread varin sacha via R-help
))   }   out } double.mad(x) # lo  hi #0.81543 0.44478 double.mad(c(x, 1)) # lo  hi #2.29803 0.44478 double.mad(c(x, 1), include.right = TRUE) # lo  hi #1.03782 1.63086 Hope this helps, Rui Barradas Às 15:22 de 03/08/2020, varin sacha via R-help escreveu: > Dear R-Exper

[R] confidence intervals for the difference between group means

2020-08-04 Thread varin sacha via R-help
Dear R-experts, Using the bootES package I can easily calculate the bootstrap confidence intervals of the means like in the toy example here below. Now, I am looking for the confidence intervals for the difference between group means. In my case, the point estimate of the mean difference is 64.

Re: [R] confidence intervals for the difference between group means

2020-08-17 Thread varin sacha via R-help
Dear Matthias, Many thanks for your response. Best, SV Le mardi 4 août 2020 à 16:22:41 UTC+2, Prof. Dr. Matthias Kohl a écrit : you could try: library(MKinfer) meanDiffCI(a, b, boot = TRUE) Best Matthias Am 04.08.20 um 16:08 schrieb varin sacha via R-help: > Dear R-expe

[R] R^2, AICc, bootstrap CIs for Orthogonal regression

2020-08-22 Thread varin sacha via R-help
Dear R-experts, I have fitted an orthogonal regression and have some difficulties to get the adjusted R^2 and R^2, the AICc, the coefficients and R^2 bootstrap confidence intervals. Here below my R codes. Many thanks for your precious help. y=c(231,212,112,143,154,165,1

<    1   2