similar to: Using a data frame in a function call

Displaying 20 results from an estimated 10000 matches similar to: "Using a data frame in a function call"

2006 Mar 16
4
excluding factor levels with read.table() and colClasses=
Hi, I am reading a "|" delimited text file into R using read.table(). I am using colClasses= to specify some variables as factors. Some of these variables include missing values coded as "NA". Unfortunately the R code I am using (pasted bellow) includes "NA" as one of the factor levels. Is it possible to remove the "NA" level from a factor with in
2018 Jul 20
3
Should there be a confint.mlm ?
It seems that confint.default returns an empty data.frame for objects of class mlm. For example: ``` nobs <- 20 set.seed(1234) # some fake data datf <- data.frame(x1=rnorm(nobs),x2=runif(nobs),y1=rnorm(nobs),y2=rnorm(nobs)) fitm <- lm(cbind(y1,y2) ~ x1 + x2,data=datf) confint(fitm) # returns: 2.5 % 97.5 % ``` I have seen proposed workarounds on stackoverflow and elsewhere, but
2003 Aug 30
1
is zscore() deprecated or Windows only?
Hi I was looking through the help on how to get standardized scores and came across an anomaly. The help.search("zscore") reports there is such a function in R.base. However, when I try to get help on zscore it reports no such function and says that R.base in built for win32. I'm running the Mac OS X version of R with the smorgasboard of packages that are included in that
2004 Sep 08
1
Case-Cohort Analysis
Hi All, I am in the middle of doing an analysis of a Case-Cohort design. I had three questions about the analysis: a) Does any one know of some public code for developing the patient risk sets (indexed by failure time) or is there a better way to organize the data? b) I was planning to use the Barlow weighting method. Has this or any other weighting method (Prentice, Self-Prentice) been
2000 Jul 05
2
couldn't find function "..."
Hi, R 1.0.1, on Linux(mandrake/RedHat). I am trying to write my first function using R and I need help figuring out the error I have indicated in the Subject line above. The purpose of the function is not to "wow" anyone, but just to serve as a stepping stone so that I might write more complicated functions in the future. First I created my function named "CIfunc" and saved
2008 Nov 18
1
Problem with the Linux R 2.8.0 rpm for 64 bit REL 4
Hi, I am trying to update my version of R on Centos 4. $uname -a Linux 2.6.9-78.0.5.ELsmp #1 SMP Wed Oct 8 07:06:30 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux I tried to update the current version of R (2.6.2) which was installed locally as an rpm $R --version R version 2.6.2 (2008-02-08) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 I used yum to
2007 Aug 06
1
(Censboot, Z-score, Cox) How to use Z-score as the statistic within censboot?
Dear R Help list, My question is regarding extracting the standard error or Z-score from a cph or coxph call. My Cox model is: - modz=cph(Surv(TSURV,STATUS)~RAGE+DAGE+REG_WTIME_M+CLD_ISCH+POLY_VS, data=kidneyT,method="breslow", x=T, y=T) I've used names(modz) but can't see anything that will let me extract the Z scores for each coefficient or the standard errors in the same
2008 Sep 18
1
caret package: arguments passed to the classification or regression routine
Hi, I am having problems passing arguments to method="gbm" using the train() function. I would like to train gbm using the laplace distribution or the quantile distribution. here is the code I used and the error: gbm.test <- train(x.enet, y.matrix[,7], method="gbm", distribution=list(name="quantile",alpha=0.5), verbose=FALSE,
2012 Oct 13
1
hep on arithmetic covariance conversion to log-covariance
Dear All,   is there a function in R that would help me convert a covariance matrix built based on arithmetic returns to a covariance matrix from log-returns?   As an example of the means and covariance from arithmetic:   mu <-c(0.094,0.006,1.337,1.046,0.263) sigma
2011 Mar 31
2
fit.mult.impute() in Hmisc
I tried multiple imputation with aregImpute() and fit.mult.impute() in Hmisc 3.8-3 (June 2010) and R-2.12.1. The warning message below suggests that summary(f) of fit.mult.impute() would only use the last imputed data set. Thus, the whole imputation process is ignored. "Not using a Design fitting function; summary(fit) will use standard errors, t, P from last imputation only. Use
2010 Aug 11
3
extracting the standard error in lrm
Hi, I would like to extract the coefficients of a logistic regression (estimates and standard error as well) in lrm as in glm with summary(fit.glm)$coef Thanks David
2013 Mar 18
1
try/tryCatch
Hi All, I have tried every fix on my try or tryCatch that I have found on the internet, but so far have not been able to get my R code to continue with the "for loop" after the lmer model results in an error. Here is two attemps of my code, the input is a 3D array file, but really any function would do.... metatrialstry<-function(mydata){ a<-matrix(data=NA, nrow=dim(mydata)[3],
2007 Dec 05
1
confint for coefficients from lm model (PR#10496)
Full_Name: Christian Lajaunie Version: 2.5.1 OS: Fedora fc6 Submission from: (NULL) (193.251.63.39) confint() does not use the appropriate variance term when the design matrix contains a zero column (which of course should not happen). Example: A 10x2 matrix with trivial column 1: > junk <- data.frame(x=rep(0,10), u=factor(sample(c("Y", "N"), 10, replace=T))) The
2006 Jul 11
3
storing the estimates from lmer
Dear all, I'm trying to store/extract the mean& standard error of the fixed effects parameter and the variance of the random effects parameter from "lmer" procedure from mlmre4 package developed by bates n pinheiro. while storing fixed effects parameter is straight forward, the same is not true for storing the variance parameter of the random effects. kindly help me ~prabhu
2007 Sep 19
3
Robust or Sandwich estimates in lmer2
Dear R-Users: I am trying to find the robust (or sandwich) estimates of the standard error of fixed effects parameter estimates using the package "lmer2". In model-1, I used "robust=TRUE" on the other, in model-2, I used "robust=FALSE". Both models giving me the same estimates. So my question is, does the robust option works in lmer2 to get the robust estimates of
2010 Aug 05
3
How to extract se(coef) from cph?
Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se(coef) for other, linear, predictors. This is just to make nice LateX tables automatically. I have the coefficients with coef(). How do I do that? Thanks, David Biau. [[alternative HTML version deleted]]
2005 Sep 29
5
Regression slope confidence interval
Hi list, is there any direct way to obtain confidence intervals for the regression slope from lm, predict.lm or the like? (If not, is there any reason? This is also missing in some other statistics softwares, and I thought this would be quite a standard application.) I know that it's easy to implement but it's for explanation to people who faint if they have to do their own programming...
2010 Jul 19
5
par("uin") ?
I inherited a function written either for an older version of R or SPlus to draw a brace, "{", in a graph. It uses par("uin") to determine the scaling of the quarter circles that make up segments of the brace, but that setting doesn't exist in current R. I'm guessing that, in the function below, ux, uy can be defined from par("usr") and
2010 Nov 22
2
Help: Standard errors arima
Hello, I'm an R newbie. I've tried to search, but my search skills don't seem up to finding what I need. (Maybe I don't know the correct terms?) I need the standard errors and not the confidence intervals from an ARIMA fit. I can get fits: > coef(test) ar1 ma1 intercept time(TempVector) - 1900
2008 May 28
1
extracting information from lmer objects
Hi, I wish to extract a subset of the information of given by summary(lmer.object) as a dataframe. In particular, I wish to extract just a table listing the Estimate, Std Error, and t-values rounded to 3 decimal places. I have learned how to extract the coefficients with "round(fixef(lmer.object),3)" and the standard errors with "round(sqrt(diag(vcov(a.lmer))),3)" but I do not