similar to: Clarification on generic functions and methods

Displaying 20 results from an estimated 7000 matches similar to: "Clarification on generic functions and methods"

2009 Nov 08
1
Summary methods
I've defined the following for objects of a class called jml summary.jml <- function(object, ...){ tab <- cbind(Estimate = coef(object), StdError = object$se, Infit = object$Infit, Outfit = object$Outfit) res <- list(call = object$call, coefficients = tab, N = nrow(object$Data), iter = object$Iterations) class(res) <- "summary.jml" res }
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb or optim returns the correct parameter estimates and, in the case of optim, the correct standard
2007 May 08
0
MiscPsycho Package 1.0
I have just submitted MiscPsycho to CRAN. MiscPsycho contains functions for miscellaneous psychometrics that may be useful for applied psychometricians. MML estimation already exists in the ltm package. Hence, a jml option is provided for users who prefer this method. The jml function gives back rasch difficulties and the same Infit and Outfit statistics as Winsteps. Also, jml is known to return
2007 May 08
0
MiscPsycho Package 1.0
I have just submitted MiscPsycho to CRAN. MiscPsycho contains functions for miscellaneous psychometrics that may be useful for applied psychometricians. MML estimation already exists in the ltm package. Hence, a jml option is provided for users who prefer this method. The jml function gives back rasch difficulties and the same Infit and Outfit statistics as Winsteps. Also, jml is known to return
2009 Nov 16
1
No Visible Binding for global variable
While building a package, I see the following: * checking R code for possible problems ... NOTE cheat.fit: no visible binding for global variable 'Zobs' plot.jml: no visible binding for global variable 'Var1' I see the issue has come up before, but I'm having a hard time discerning how solutions applied elsewhere would apply here. The entire code for both functions is below,
2009 Oct 21
1
formula and model.frame
Suppose I have the following function myFun <- function(formula, data){ f <- formula(formula) dat <- model.frame(f, data) dat } Applying it with this sample data yields a new dataframe: qqq <- data.frame(grade = c(3, NA, 3,4,5,5,4,3), score = rnorm(8), idVar = c(1:8)) dat <- myFun(score ~ grade, qqq) However, what I would like is for the resulting dataframe (dat) to include
2010 Mar 10
2
help R non-parametric IRT simulation
Hello R, I am looking for non-parametric simulation in IRT. Is there any IRT package that does non-parametric simulation? helen L [[alternative HTML version deleted]]
2009 Aug 07
1
Gauss-Laguerre using statmod
I believe this may be more related to analysis than it is to R, per se. Suppose I have the following function that I wish to integrate: ff <- function(x) pnorm((x - m)/sigma) * dnorm(x, observed, sigma) Then, given the parameters: mu <- 300 sigma <- 50 m <- 250 target <- 200 sigma_i <- 50 I can use the function integrate as: > integrate(ff, lower= -Inf, upper=target)
2010 Aug 25
1
RCMD CHECK and non-methods
I recently moved a function 'subset.with.warning' into the 'mvbutils' package (a version not yet on CRAN). When I tried RCMD CHECK, I got this warning: * checking S3 generic/method consistency ... WARNING subset: function(x, ...) subset.with.warning: function(x, cond, mess.head, mess.cond, row.info, sub) See section 'Generic functions and methods' of the
2008 Apr 24
4
bug in file.path?
Se ha borrado un texto insertado con un juego de caracteres sin especificar... Nombre: no disponible Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080424/2226f24e/attachment.pl
2009 Mar 16
1
Uniroot and Newton-Raphson Anomaly
I have the following function for which I need to find the root of a: f <- function(R,a,c,q) sum((1 - (1-R)^a)^(1/a)) - c * q To give context for the problem, this is a psychometric issue where R is a vector denoting the percentage of students scoring correct on test item i in class j, c is the proportion correct on the test by student k, and q is the number of items on the test in total. I
2009 Oct 20
1
Suggestion for exception handling: More informative error message for "no applicable method..." (S3)
I'd like to suggest that whenever there is no S3 method implementation available for a particular class, that the error message would also report the class structure of the object dispatched on. Example: foo <- function(...) UseMethod("foo") foo.ClassA <- function(object, ...) { cat("foo() for ClassA called.\n") } > foo(structure(1, class="ClassA"))
2014 Jul 05
2
mdiskchk and WinPE
Greetings, all... Hoping someone can point me in the right direction. I've set up a Linux PXE host with a menu choice to install Windows. This option boots a WinPE image, which then uses \\net use... to mount the appropriate ISO image. Works fine. However, I would like to pass the iso name and directory into WinPE from the menu via append= arguments. Thus, I can set up a separate menu option
2007 Apr 27
0
Protocol for data inclusion in new packages
In the near future I will release MiscPsycho, a package that contains various functions useful for applied psychometricians. I would like to include some data sets for distribution in the package, but have not created any of these on my own, but have used data distributed in other packages such as the LSAT data in the ltm package. Is it appropriate for me to distribute a data set in the package I
2008 Jun 10
2
Slow function
Hi, I have the following function that I want to apply to a list of 14 matrices (1536 x 170) of binary data: DRes <- function(x, nr = 10000, metric = "mixed", ...) { require(analogue) require(ade4) m <- c() for (i in 1:nr) { set.seed(i) x1 <- x[, sample(dimnames(x)[[2]], length(x[1,])/2)] x2 <- x[, !dimnames(x)[[2]] %in% dimnames(x1)[[2]]] d1 <-
2009 Mar 31
1
Selecting Bootstrap Statistics in the boot package
Dear all, Let's say I have the following: # Loading the boot package # install.packages(boot) library(boot) # Generating data set.seed(123) x <- rnorm(100) # Bootstrap for the sample mean bmean <- boot(x, function(x,d) mean(x[d]), R=1000) bmean # #ORDINARY NONPARAMETRIC BOOTSTRAP # # #Call: #boot(data = x, statistic = function(x, d) mean(x[d]), R = 1000) # # #Bootstrap Statistics : #
2007 Dec 06
1
S3 and S4 clash
Hello: How can I work around the conflict between the S3 and S4 illustrated in the example below? I'm developing a package that requires a function in 'stats4', but when 'stats4' is attached, it breaks my AIC function. I could give my AIC function another name so it no longer uses the generic dispatch, but I wonder if there is another way. Thanks,
2009 Nov 18
0
Package for Miscellaneous Psychometrics
Version 1.5 of the MiscPsycho package had been uploaded to CRAN (should hit mirrors in a day or so). This package has a set of functions that may be useful for psychometric applications. The package has been updated to include the following: 1) All functions (where appropriate) now use standard formula arguments 2) All functions now use S3 print and summary methods 3) Help files have been
2002 Feb 28
1
Bug in julian() (PR#1332)
Full_Name: Michael Jacob Version: 1.4.1 OS: Windows 2000 SP2 Submission from: (NULL) (195.27.237.226) Hi, there seems to be a bug in julian(): > Sys.getlocale() [1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=English_United States.1252" > julian(Sys.time()) Error in fromchar(x) : character string is not in a
2010 Aug 19
1
Why does Bootstrap work for one of similar models but not for the other?
Dear all, Could anyone help me figure out why bootstrap works for one of similar models but not for the other and how I can solve it? I am using R 2.11.1 in Windows and would like to get confidence intervals for my models A and B by bootstrapping. However, bootstrap gives expected output for the model A but not for B, which I found was puzzling because the structure of the models is