similar to: code optimization

Displaying 20 results from an estimated 11000 matches similar to: "code optimization"

2002 Jun 24
10
code optimization
I have a function "eval.delta" which does what I want but isn't very elegant. I have consulted the R documents, MASS, and S Programming. Is there a practical way to optimize the code? Thank you very much. Peter B. Function: eval.delta <- function(delta){ cat("VALUES\n") vlr <- NULL k <- 0 for(j in 1:length(delta)) if(delta[j] <= 2){
1999 Jul 14
1
How to cite
I am updating my lab manual in Spanish. How should I cite your supplements to Venables and Ripley 1997 and the scripts. Thank you very much Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx Facultad de Medicine Tel: 48 26-23-45 ext. 232
1999 Jun 07
0
How to superimpose a histogram and density plot
NCSS has a nice plot of the histogram and density plot superimposed. The S-PLUS 4 Guide to Statistics on page 45 suggests the following code for a general purpose density plot for a vector named data iqd <- summary(data)[5]-summary(data)[2] plot(density(data,width=2*iqd),xlab="x",ylab="",type="l") Is it possible to superimpose the density plot on a histogram
1999 Jun 29
1
manova
I am using rw0641 with Windows 98. In the help for aov it states that the formula can sepecify multiple responses for a "maov". The help doesn't give an example, Venables and Ripley 1997:381 doesn't either. It isn't mentioned in the scripts nor in the section R Complements nor in Rnotes. I tried aov(c(y1,y2,y3)~x) which seemed reasonable to me but doesn't work. How
2001 Jan 09
1
Chambers and Hastie Data Sets
Is there any place where the Chambers and Hastie 1993 Statistical Models in S data sets can be found? Thank you very much. Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx Facultad de Medicine Tel: 48 26-23-45 ext. 232 Universidad Aut?noma de San
2001 Jan 17
1
panel argument in coplot
How can I add a least squares line to each panel in coplot? Thank you very much. Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del Depto. de Inform?tica y Bioestad?stica rpe1531 at pasteur.fmed.uaslp.mx Facultad de Medicine Tel: 48 26-23-45 ext. 232 Universidad Aut?noma de San Luis Potos? Fax: 48 28-23-52 Av.
1999 Oct 05
2
for loops and counters
I am trying to assign values to a vector (pvalue). Similar code works in C but not in R. What am I doing wrong? r <- pvalue <- 0 for(i in (1:(k-1))){ for(j in (i+1):k){ r <- r+1 tstat <- (means[i]-means[j])/rms pvalue[r] <- 2*(1-pt(abs(tstat),df)) } } Thank you. Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del
1999 Jul 14
3
vector of NA indices
I have a vector Pes with 600 elements some of which are NA's. How can I form a vector of the indices of the NA's. for(i in 1:600) if(is.na(Pes[i])) print(i) prints the indices of the NA's but I can't figure out how to put the results in a vector. Thank you very much. Peter B. -- Peter B. Mandeville mandevip at deimos.tc.uaslp.mx Jefe del Depto. de
1999 Jun 23
1
Influence.measures
I am using rw0641 with Windows 98. To list just the influential repetitiones that result from "influence.measures", I am using the input result <- lm(y~x) and the code from the example in the help for "influence.measures" INFLM <- function(result){ inflm <- influence.measures(result) which(apply(inflm$is.inf,1,any)) } It works fine up to now with the
2013 Apr 11
4
Asterisk 11.2.1 / dahdi destroy channel / asterisk crashes
Hi, I have the following setup: Ubuntu 12.04.02 LTS (64 bit) Asterisk 11.2.1 Sangoma 4-Port-Card (A104d) with firmware 43 (german e1-ports connected) WANPIPE Release: 3.5.28 DAHDI Version: 2.6.1 Echo Canceller: HWEC libpri version: 1.4.12 I call via sip into the dialplan. Then I do a "Dial(DAHDI/g1/voicenumber,r)". The call is bridged and everything is fine. "dahdi show
2000 Jul 05
1
Tukey.aov with split-plot designs
I am using R 1.1 with Redhat 6.2 and RW 1.001 with Win98 (the upkey doesn't work on my IBM either as has been previously reported by others). The function aov doesn't return either the residuals or the residual degrees of freedom for split-plot designs. If you use the following code from Baron and Li's "Notes on the use of R for psycology experiments and questionnaires"
2001 Jun 15
1
contrasts in lm and lme
I am using RW 1.2.3. on an IBM PC 300GL. Using the data bp.dat which accompanies Helen Brown and Robin Prescott 1999 Applied Mixed Models in Medicine. Statistics in Practice. John Wiley & Sons, Inc., New York, NY, USA which is also found at www.med.ed.ac.uk/phs/mixed. The data file was opened and initialized with > dat <- read.table("bp.dat") >
1999 Jul 01
1
lme
I am using rw0641. In my continuing quest to understand repeated measures analysis, I again return to lme. I exported the Potthoff and Roy data Orthodont.dat from S-PLUS 4.5 to avoid capture errors and ran the examples in the R help. I imported the data.frame with data <- read.table("Orthodont.dat",header=T) attach(data) and created the objects Orthodont.fit1 <-
1999 Jul 23
2
rw0642
Among other computers, I am using rw0642 on an IBM 300GL with 32MB RAM and Windows98. 1. If after opening rw0642 the first command is to help such as "? par", when the help window is closed by clicking X in the upper right corner of the help window the following message is shown This program has performed an illegal operation and will be shut down. If the problem persists contact the
2008 Nov 21
1
question about shapiro.test()
Hi all! I tried to perform Shapiro-Wilk test for my sample of 243 values. > Us [1] -10.4 -13.1 -12.2 38.1 -18.8 -13.3 -11.7 29.3 49.7 6.8 12.7 16.3 [13] 5.8 -0.7 -29.4 4.1 38.8 -1.4 8.8 15.6 32.9 -5.3 19.1 35.8 [25] 4.0 -1.5 0.6 -4.2 -10.0 -4.0 1.1 48.9 -21.0 -5.3 5.8 -10.8 [37] 21.9 8.2 -3.2 -3.9 -2.3 12.6 -4.7 -8.0 11.8 27.4 -9.5 -20.8 [49]
2000 Jul 11
3
postscript()
I am using RedHat 6.1, the R1.1.0 binary download, and an HP Deskjet 692C. For some time I have been trying unsuccessfully to integrate R postscript graphics in LaTex. I consulted the Bug Tracking System. In the preamble of the LaTex file (test.tex) I have placed the line \usepackage{graphicx,color} and I use \begin{figure}[htbp] \begin{center} \includegraphics[height=4in]{graphic1.ps}
2007 Aug 09
2
Systematically biased count data regression model
Dear all, I am attempting to explain patterns of arthropod family richness (count data) using a regression model. It seems to be able to do a pretty good job as an explanatory model (i.e. demonstrating relationships between dependent and independent variables), but it has systematic problems as a predictive model: It is biased high at low observed values of family richness and biased low at
2009 Aug 16
2
Question regarding finding credible interval using r2winbugs
Dear I am trying to find a 90% credible interval. I am using the following code. fit<-bugs( model.file=BUGScode, data=data, inits = list(geninits1,geninits2), parameters.to.save=keepers, n.chains=nchains, n.iter=runs, n.burnin=burn, n.thin=nthin, DIC= TRUE, bugs.directory="C:/Program Files/WINBUGS.14", \ ) But this is only giving 95%
2011 Jun 16
2
Bayesian Credible Intervals for a Proportion
I am trying to calculate Bayesian Credible Intervals for a proportion (disease prevalence values to be more specific) and am having trouble using R to do this. I am working with ncredint() function but have not had success with it. Please help! Example: Positive samples = 3 Total sampled = 10 Prevalence = 0.3 pvec <- seq(1,10,by=1) npost = dbinom(pvec,10,prob=0.3, log=FALSE) ncredint(pvec,
2012 Apr 06
2
Bayesian 95% Credible interval
Hi all, I have the data from the posterior distribution for some parameter. I want to find the 95% credible interval. I think "t.test(data)" is only for the confidence interval. I did not fine function for the Bayesian credible interval. Could some one suggest me? Thanks [[alternative HTML version deleted]]