similar to: Help with function writing

Displaying 20 results from an estimated 500 matches similar to: "Help with function writing"

2011 Feb 04
1
GWAF package: lme.batch.imputed(): object 'kmat' not found
Hello, All, GWAF 1.2 R.Version() is below. system(lme.batch.imputed( phenfile = 'phenfile.csv', genfile = 'CARe_imputed_release.0.fhsR.gz', pedfile='pedfile.csv', phen='phen1', covar=c('covar1','covar2'), kinmat='imputed_fhs.kinship.RData', outfile='imputed.FHS.IBC.GWAF.LME.output.0.txt' )) Gives the error messages: Error in
2009 Apr 26
1
Stochastic Gradient Ascent for logistic regression
Hi. guys, I am trying to write my own Stochastic Gradient Ascent for logistic regression in R. But it seems that I am having convergence problem. Am I doing anything wrong, or just the data is off? Here is my code in R - lbw <- read.table("http://www.biostat.jhsph.edu/~ririzarr/Teaching/754/lbw.dat" , header=TRUE) attach(lbw) lbw[1:2,] low age lwt race smoke ptl ht ui ftv
2009 Jul 02
0
MCMCpack: Selecting a better model using BayesFactor
Dear R users, Thanks in advance. I am Deb, Statistician at NSW Department of Commerce, Sydney. I am using R 2.9.1 on Windows XP. This has reference to the package “MCMCpack”. My objective is to select a better model using various alternatives. I have provided here an example code from MCMCpack.pdf. The matrix of Bayes Factors is: model1 model2 model3 model1 1.000 14.08
2011 Jun 13
0
How to formulate an (effect-modifying) interaction with matching variable in a conditional logistic regression?
Hi, I would like to see if a matching variable is an effect-modifier in a conditional logistic regression. Naturally, the matching variable can't enter directly in the model but as an interaction with terms that are in. However, I have problems in formulating the correct model the term that's already in the model is a factor. I am using treatment contrasts and the problem is that if I
2012 Nov 04
1
structural equations using sem package
Hello I am using sem to look at the direct effect of one variable on another but i am uncertain if i am progressing correctly. An example: covar1<-? matrix(c(0.4,-0.2,3,-0.2 , 0.3,-2 , 3 ,-2 , 60), nrow=3,byrow=T) rownames(covar1)<-colnames(covar1)<-c("endo","exo","med") path1<-matrix(c(? ? "exo -> endo",? "g1", NA,
2010 Feb 12
1
validate (rms package) using step instead of fastbw
Dear All, For logistic regression models: is it possible to use validate (rms package) to compute bias-corrected AUC, but have variable selection with AIC use step (or stepAIC, from MASS), instead of fastbw? More details: I've been using the validate function (in the rms package, by Frank Harrell) to obtain, among other things, bootstrap bias-corrected estimates of the AUC, when variable
2008 Aug 18
1
GeoR model.control - defining covariates at prediction locations
Hi, Im using geoR and I'm trying to do some predictions, based on an external trend. I'm having some problems specifying my model.control, specifically how do I define my model, and also the source of the covariate data at the prediction locations? I am assuming that the covariate data at the prediction locations should be imported to a geodata object along with the prediction location
2005 Oct 18
1
Re : Seperate timestamp data into date and time
Dear R list, I am reading in text file data prepared in Access database by someone. One of the field contains timestamp data, how can I separate the timestamp data into two varaibles: date and time. Can I specify the field is in timestamp format when I first reading in ? My reading in data are as below: 449 LWT 22/10/2003 15:43:00 441 143 449 LWT 17/11/2003 15:25:00 421 169 449 LWT
2008 Oct 11
1
step() and stepAIC()
The birth weight example from ?stepAIC in package MASS runs well as indeed it should. However when I change stepAIC() calls to step() calls I get warning messages that I don't understand, although the output is similar. Warning messages: 1: In model.response(m, "numeric") : using type="numeric" with a factor response will be ignored (and three more the same.) Checked
2013 Feb 15
2
Making the plot window wider and using the predict function
Hello, I am new to R and have a couple of questions. My data set contains the variables "Bwt" and "Hwt", which are bodyweight and heartweight, respectively, of a group of cats. With the following code, I am making two plots, both to be viewed in the same plot window in R: library(MASS) maleData <- subset(cats, Sex == "M") linreg0 <- lm(maleData$Hwt ~
2003 Jan 21
1
Logistic regression: At times correlation matrix of coefficients gets messed up
Hi, When I include a categorical variable (RACE with 3 levels - "white", "black" and "other") in my logistic regression model, the correlation matrix of the coefficients gets messed up. I get something like: ----------------------------------------- Correlation of Coefficients: ( A L RACEb AGE , 1 LWT , 1 RACEblack 1
2010 Sep 07
1
how to combine several subsets?
I simply put, > NEVER=subset(infants$bwt,ISNO1) > UNTILPREGNANT=subset(infants$bwt, ISNO2) > ONCENOTNOW=subset(infants$bwt, ISNO3) and I wanna combine those three. I do it like ISNO=NEVER&UNTILPREGNANT&ONCENOTNOW and R tells me 1: In NEVER & UNTILPREGNANT : longer object length is not a multiple of shorter object length 2: In NEVER & UNTILPREGNANT & ONCENOTNOW
2018 May 30
1
CRAN checks give errors when no tests are included
Dear all, as a follow-up to the question asked on R-package-devel (see link below): Someone sent a package to CRAN with a few problems. There's more things wrong with the submission, but one thing that really caught my eye was the following error: Warning message: running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD BATCH --vanilla "testthat.R"
2007 Jul 05
17
ZFS Compression algorithms - Project Proposal
Bellow, follows a proposal for a new opensolaris project. Of course, this is open to change since I just wrote down some ideas I had months ago, while researching the topic as a graduate student in Computer Science, and since I''m not an opensolaris/ZFS expert at all. I would really appreciate any suggestion or comments. PROJECT PROPOSAL: ZFS Compression Algorithms. The main purpose of
2006 Aug 03
1
how to use the EV AND condEV from BMA's results?
Dear friends, In R, the help of "bic.glm" tells the difference between postmean(the posterior mean of each coefficient from model averaging) and condpostmean(the posterior mean of each coefficient conditional on the variable being included in the model), But it's still unclear about the results explanations, and the artile of Rnews in 2005 on BMA still don't give more detail on
2013 Feb 28
3
Hidden information in an object
Hello, The dataset "cats" contain information about the heart weight ("Hwt"), body weight ("Bwt") and gender ("Sex") of a group of 144 cats. I write the following piece of code: library(MASS)attach(cats)ratio <- Hwt/Bwtmale <- ratio[Sex == "M"]female <- ratio[Sex == "F"] My question is, when I look at the object
2009 Feb 04
2
Sweave and \Sexpr{}
Hi: I am trying to create a dynamic latex table using \Sexpr{} but it's not evaluating it. I also tried the example below without Sweave and also fails. I have also copied the Sweave.sty to my working directory but nothing seems to work. Do I need to have certain package in order to run \Sexpr{}? \documentclass[a4paper]{article} \usepackage{C:/R/R-2.8.1/share/texmf/Sweave} \begin{document}
1999 Jan 07
2
errores
Happy New Year to all, I am using RW0631 and WIN98. 1. The command DATA only works for the base library. 2. The following code on page 312 of Venables and Ripley 1997 sitka.lme <- lme(size~treat*ordered(Time),random=~1,cluster=~tree,data=Sitka, serial.structure="ar1.continuous",serial.covariate=~Time) produced the following error message Error in lme(size ~ treat *
2008 Dec 19
0
"parm" argument in confint.multinom () nnet package
Dear R users, The nnet package includes the multinom method for the confint function. The R Help file (?confint) for the generic function in the stats package and the help files for the glm and nls methods in the MASS package indicate that one can use the "parm" argument as "a specification of which parameters are to be given confidence intervals, either a vector of numbers or
2002 Jan 18
1
RE: z-scores for different factor levels
Hi Stuart, I often use this small function standardize <- function(x) ( x - mean(x, na.rm=T) ) / sqrt(var(x, na.rm=T)) to standardize variables. You should be able to use this to do what you want by splitting the data frame into sections based on the factor level, using standardize() to create a new variable in each section, then paste the data frame back together. Something like: #