similar to: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())

Displaying 20 results from an estimated 400 matches similar to: "predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())"

2006 Apr 05
0
Return function from function and Recall()
Hi, yesterday I got very useful feedback on what is the best way to return a function from a function. Now, I run into a problem calling a returned function that down the stream uses Recall(). Below is a self-contained example. I took away yesterday's code for returning a minimal environment for the function, because that is not related to this problem. getPredictor <- function(x, y) {
2006 Apr 05
1
page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))
Here I think S3 dispatch is very natural. Try the following: page <- function(x, method = c("dput", "print"), ...) UseMethod("page") page.getAnywhere <- function(x, ..., idx=NULL) { name <- x$name; objects <- x$obj; if (length(objects) == 0) stop("no object named '", name, "' was found"); if (is.null(idx)) {
2018 May 22
2
Bootstrap and average median squared error
I forgot, you should also set.seed() before calling boot() to make the results reproducible. Rui Barradas On 5/22/2018 10:00 AM, Rui Barradas wrote: > 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,
2018 May 21
2
Bootstrap and average median squared error
Dear R-experts, I am trying to bootstrap (and average) the median squared error evaluation metric for a robust regression. I can't get it. What is going wrong ? Here is the reproducible example. ############################# install.packages( "quantreg" ) library(quantreg) crp <-c(12,14,13,24,25,34,45,56,25,34,47,44,35,24,53,44,55,46,36,67) bmi
2012 Jan 09
2
[R] fix and edit don't work: unable to open X Input
(moved from R-help) I tried this on Ubuntu with R-2.14.1 built from source, and I do not get the segfault problem. (I don't at the moment have a debian binary R, or I would confirm whether I get the segfault problem.) My sessioninfo() is reporting additional information about namespace imports: > library(ggplot2) Loading required package: reshape Loading required package: plyr
2018 May 22
1
Bootstrap and average median squared error
Hello, Right! I copied from the OP's question without thinking about it. Corrected would be 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) } Sorry, rui Barradas On 5/22/2018 11:32 AM, Daniel Nordlund wrote: > On 5/22/2018
1999 Dec 20
1
nonlinear least square optimization
Hi, I've been using "nlregb" routine in splus3.4, but cannot find it here in R. Is it hidden in some library? Or there is a routine equivalent to it but with a different name? I'm planning to move part of my from S to R so that I can work comfortablely at home. Any suggestion is highly appreciated. regards, Tony -- \|||/ Q o o Q ==========================oooQ= ( -
2018 May 22
0
Bootstrap and average median squared error
On 5/22/2018 2:32 AM, Rui Barradas wrote: > 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 > } since the OP is looking for the "median squared error", shouldn't the final line of the
2011 Sep 23
1
Adding weights to optim
I realize this may be more of a math question. I have the following optim: optim(c(0.0,1.0),logis.op,x=d1_all$SOA,y=as.numeric(md1[,i])) which uses the following function: logis.op <- function(p,x,y) { ypred <- 1.0 / (1.0 + exp((p[1] - x) / p[2])); res <- sum((y-ypred)^2) return(res) } I would like to add weights to the optim. Do I have to alter the logis.op function by
2012 Jan 08
1
fix and edit don't work: unable to open X Input Method->segfault
I can't run fix() or edit() anymore. Did I break my system? I'm running Debian Linux with R-2.14.1. As far as I can tell, the R packages came from Debian's testing "wheezy" repository. I would like to know if users on other types of systems see the same problem. If no, then, obviously, it is a Debian-only issue and I can approach it from that point of view. And if no other
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 <-
2012 Mar 06
1
PLS Error message
Hi, I work with hyperspectral remote sensing data and I try to built a pls model with this data. I already built the model but if I try to calculate the RMSEP and R2 with a test data set I get the following error message: Error: variable 'subX' was fitted with type "nmatrix.501" but type "nmatrix.73" was supplied The problem is that I don't get the message for
2008 Nov 26
1
Smoothed 3D plots
DeaR list, I'm trying to represent some information via 3D plots. My data and session info are at the end of this message. So far, I have tried scatterplot3d (scatterplot3d), persp3d (rgl), persp (graphics) and scatter3d (Rmcdr) but any of them gave me what I'd like to have as final result (please see [1] for a similar 3D plot changing PF by ypred, pdn by h4 and pup by h11). In general
2011 Jan 27
2
Extrapolating values from a glm fit
Dear R-help, I have fitted a glm logistic function to dichotomous forced choices responses varying according to time interval between two stimulus. x values are time separation in miliseconds, and the y values are proportion responses for one of the stimulus. Now I am trying to extrapolate x values for the y value (proportion) at .25, .5, and .75. I have tried several predict parameters, and they
2009 Sep 04
1
User defined function's argument as Subset function's input
Dear R users, I have a data where I desire to subset according to certain conditions. However, the script is very messy as there are about 30 distinct conditions. (i.e. same script but with different conditions) I would like to make a user defined function so that I can input the desired conditions and just get the results accordingly. Below is an arbitrary data set & sample statements
2012 Feb 25
1
Unexpected behavior in factor level ordering
Hello, Everybody: This may not be a "bug", but for me it is an unexpected outcome. A factor variable's levels do not retain their ordering after the levels function is used. I supply an example in which a factor with values "BC" "AD" (in that order) is unintentionally re-alphabetized by the levels function. To me, this is very bad behavior. Would you agree? #
2023 Oct 22
1
running crossvalidation many times MSE for Lasso regression
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) ?
2003 Nov 04
1
Error in edit.data.frame
I recently attempted to read a .txt file using both read.table(" ",header=TRUE) and read.delim(" ",header=TRUE) and received the following message Error in edit.data.frame(get(subx, envir = parent), ...) : symbol print-name too long I am able to also create a variable x<-read.delim (" ",header=TRUE ) , but am unable to fix(x) because
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
2006 Aug 10
1
logistic discrimination: which chance performance??
Hello, I am using logistic discriminant analysis to check whether a known classification Yobs can be predicted by few continuous variables X. What I do is to predict class probabilities with multinom() in nnet(), obtaining a predicted classification Ypred and then compute the percentage P(obs) of objects classified the same in Yobs and Ypred. My problem now is to figure out whether P(obs) is