Re: [R] Predictions with missing inputs

2011-02-12 Thread Bernardo Rangel Tura
ed <- predict(mymodel, mynewdata) > Thanks in advance for your help! > > Axel. Axel, I think mice package solve your problem -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing

Re: [R] can't find and install reshape2??

2010-10-12 Thread Bernardo Rangel Tura
lled 'stringr' pakage 2- Your R is outdated Try this two things and after this mail me -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] read columns of quoted numbers as factors

2010-10-05 Thread Bernardo Rangel Tura
ypur problem using the options colClasses in the read.table command, something like this rea.table('name.of.table',colClasses=c(rep(30,'integer'),rep(5,'numeric'),etc)) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil _

Re: [R] Calculating with tolerances

2010-09-09 Thread Bernardo Rangel Tura
P = 5 * Q * H > > and get a value with a tolerance +- > > What is the elegant way of doing this in R? > > Thank you, > Jan Hi Jan, If I understood your problem this script solve your problem: q<-0.15 + c(-.1,0,.1) h<-10 + c(-.1,0,.1) 5*q*h [1] 2.475

Re: [R] levene.test

2010-07-14 Thread Bernardo Rangel Tura
s use leveneTest (?levene.test again)If you type ?leveneTest you get examples -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] F# vs. R

2010-07-07 Thread Bernardo Rangel Tura
l code is in C o FORTRAN So I think the F# is not a good alternative, if your concern is velocity dou you look Littler http://code.google.com/p/littler/ -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-projec

Re: [R] How to determine if R is 64 bit compiled under Unix-alike?

2010-07-05 Thread Bernardo Rangel Tura
eems to work the same/right as with R64 under MacOS. > > Pms. > Type .Machine$sizeof.pointer If respond is 8 your R is 64 bits -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.o

Re: [R] Best way to compute a sum

2010-07-04 Thread Bernardo Rangel Tura
ifelse (sum(rep(1.1,100))>sum(rep(11,100))/10, "greater than", > "less than orequal") > > [1] "greater than" Hi Roger, First of all, is true > sum(rep(1.1,100))==sum(rep(11,100))/10 [1] FALSE But is true too > all.equal(sum(rep(1.1,

Re: [R] Best way to compute a sum

2010-07-03 Thread Bernardo Rangel Tura
ad: What Every Computer Scientist Should Know About Floating-Point Arithmetic ( http://docs.sun.com/source/806-3568/ncg_goldberg.html ) I think your question and others like this question is answer in this paper -- Bernardo Rangel Tura, M.D,MPH,Ph.D Nation

Re: [R] identifying odd or even number

2010-07-01 Thread Bernardo Rangel Tura
ersity of Ilorin Hi Yemi! Your problem is solve wiht "!" and "%%", Look this example > x <- 1:11 > x [1] 1 2 3 4 5 6 7 8 9 10 11 > x%%2 [1] 1 0 1 0 1 0 1 0 1 0 1 > !(x%%2) [1] FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE --

Re: [R] Calculation of r squared from a linear regression

2010-06-11 Thread Bernardo Rangel Tura
4 F-statistic: 77.76 on 1 and 2 DF, p-value: 0.01262 betax <- fm1$coeff[2] * sd(x) / sd(y) # cd is coefficient of determination cd <- betax * cor(y, x) cd x 0.974924 The formula "fm1$coeff[2] * sd(x) / sd(y)" is valid only the model have a intercept... -- Bernardo Ran

Re: [R] How sample without replacement on more than one variables?

2010-05-23 Thread Bernardo Rangel Tura
;- data.frame(v1=v1, v2=v2, v3=v3) And now is simple, sample the row of data frame aa[sample(1:nrows(aa),3),] -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] Minimization problem

2010-05-20 Thread Bernardo Rangel Tura
st . > > F. Hi! Do you need use optim, something like this test <- function(parameters){ m.error <- mean(distribution(x1,x2,x3) ) - observed mean m.sd <- std(distribution(x1,x2,x3)) - observed std res <- cbind(m.error,sd.error) return(res) }

Re: [R] Simple question on binning data

2010-05-15 Thread Bernardo Rangel Tura
> > The one I wrote for myself discards any partial bin (101-107 in my > example) and leaves a warning note that this took place. > > Carl Hi Carl, I think the syntactically correct is x[10*i:(11*i-1)] -- Bernardo Rangel Tura, M.D,MPH,Ph.D

Re: [R] Generate Numbers

2010-04-04 Thread Bernardo Rangel Tura
my direct approach but why you don't use data <- c(runif(25,number,540),runif(50,540,715),runif(25,715,number)) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] compare two fingerprint images

2010-04-03 Thread Bernardo Rangel Tura
w if you can do with R. > > Thank you very much > > Juan > > > Bernardo Rangel Tura escribió: > > On Fri, 2010-04-02 at 20:52 +0200, Juan Antonio Gil Pascual wrote: > > > >> Hello > >> I wanted to compare two fingerprint images. How do yo

Re: [R] compare two fingerprint images

2010-04-03 Thread Bernardo Rangel Tura
w exactly what you need but try this; require(ReadImages) x <- read.jpeg(image1) x1 <- read.jpeg(image2) table(x1==x) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://st

Re: [R] Changing content of column in data.frame + efficient join extraction between 2 data.frames

2010-03-23 Thread Bernardo Rangel Tura
nge to lower case Second: try merge (East,pcs,by.x=str_1,by.y=str_1) to fusion data frames Third: I don't recreate your database East in my computer do you give a small part to I try solve your problem? -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil

Re: [R] queue simulation

2010-03-22 Thread Bernardo Rangel Tura
f dispatch rate 0.4, use the command times <- rexp(10,0.4) If I need the total delay for each person, use the command cumsum(times) If I need the average time in the queue, use the command means(cumsum(times)) -- Bernardo Rangel Tura, M.D,M

Re: [R] different forms of nls recommendations

2010-03-21 Thread Bernardo Rangel Tura
rt") temp_nls6 <- nls(ECe~(100/(b-14.7127 * WTD^(-1.01613))),data=US.final.values,start=list(b=70.4936),trace=TRUE,algorithm="port") temp_nls7 <- nls(ECe~(a/(70.4936-14.7127 * WTD^(-1.01613))),data=US.final.values,start=list(a=100),trace=TRUE,algorithm="port") 0: 2243

Re: [R] fisher.test gives p>1

2010-03-04 Thread Bernardo Rangel Tura
AQ 7.31, but look this command all.equal(dput(fisher.test(matrix(c(14,14,29,29,16,16),byrow=T,ncol=2))$p.value),1) 1.000012 [1] TRUE P.S R FAQ 7.31 - http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f -- Bernardo Rangel Tura, M.D,MP

Re: [R] Problem in performing goodness of fit test in R.

2010-02-14 Thread Bernardo Rangel Tura
probabilities data: freq X-squared = 6.72, df = 5, p-value = 0.2423 About the third line You must read ?chisq.test for better know the command, but you execute one chi-square test with uniform probability distribution -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Br

Re: [R] using tabble

2010-01-18 Thread Bernardo Rangel Tura
5),3) table(x) x 3 4 5 6 7 3 3 3 3 3 In this example the values "1" and "2" are missing Solution change your variable to factor and determine your leveal x.factor<-factor(x,levels=1:7) table(x.factor) x 1 2 3 4 5 6 7 0 0 3 3 3 3 3 -- Bernardo Rangel Tura, M.D,M

Re: [R] Help with function "fitdistr" in "MASS"

2010-01-03 Thread Bernardo Rangel Tura
eed > your help. > > Thank you in advanced, > Saji from Shanghai Hi Sajj, You hava NA in your data try: fitdistr(na.exclude(mydata),"normal") -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-h

Re: [R] Problem with "Cannot compute correct p-values with ties"

2009-12-22 Thread Bernardo Rangel Tura
a,jitter(b)) Wilcoxon rank sum test data: a and jitter(b) W = 49, p-value = 0.9705 alternative hypothesis: true location shift is not equal to 0 look ?jitter for more information -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil _

Re: [R] areg (stata) equivalent in R?

2009-12-01 Thread Bernardo Rangel Tura
an applicable function. thanks for any help. > John, Do you show a example for this command? I don't know stata so I don't help you -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.or

Re: [R] "subset" or "condition" as argument to a function

2009-11-21 Thread Bernardo Rangel Tura
t is pltit <- function(y,x,dat,dat1,dat2,sbst) { subs <- subset(dat,sbst) with(subs,plot(y~x)) subs1 <- subset(dat1,sbst) with(subs1,lines(y~x)) subs2 <- subset(dat2,sbst) with(subs2,points(y~x)) } -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil _

Re: [R] negative log likelihood

2009-11-09 Thread Bernardo Rangel Tura
(model) 'log Lik.' -40.1177 (df=3) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.o

Re: [R] operation with if/else on a dataframe

2009-10-29 Thread Bernardo Rangel Tura
(x>5 & y>15 & z>10,"UP", ifelse(x<5 & y<15 & z<10,"DOWN", "0")) dta First, I use ifelse command to simplify your nested conditional situation. Second, I know that R test this nested condition

Re: [R] attach

2009-10-18 Thread Bernardo Rangel Tura
ch a data.frame twice times, it use your memory twice times. I don't use attach I prefer with(data.frame, command) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.

Re: [R] stochastic process

2009-10-13 Thread Bernardo Rangel Tura
pratical use command mtx.exp of Biodem package, something like this require(Biodem) # # 10th step direct # initial%*%mtx.exp(transition,10) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing lis

Re: [R] row selection

2009-10-11 Thread Bernardo Rangel Tura
out of bounds > > Can any body point out the problem? Hi Ashta, If I understand your request you need select row 5,10,15, ... In this case you can use this script: x[1:nrow(n)%%5==0] -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil ___

Re: [R] Setting a mirror "permanently" on R on ubuntu

2009-10-10 Thread Bernardo Rangel Tura
> This is because of the error I keep on getting below and I dont know how to > solve it. > > Please help. > > Kind regards, > Lazarus Lazarus, use options(repos="mirror URL") -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil

Re: [R] Satellite ocean color palette?

2009-10-09 Thread Bernardo Rangel Tura
e.plot(volcano, col = Satelite.Pallete(500), legend.lab="Scale") contour(volcano, levels = seq(90, 200, by = 5), add = TRUE) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https:

Re: [R] aproximate a titration kurve to the measure data.

2009-10-02 Thread Bernardo Rangel Tura
, 2.86, 2.33, 2.11, 1.98) > > with regards Ok temp<-data.frame(ph2,v2) > drm(temp,, fct = LL.4()) A 'drc' model. Call: drm(formula = temp, fct = LL.4()) Coefficients: b:(Intercept) c:(Intercept) d:(Intercept) e:(Intercept) 39.420 2.425 11.487

Re: [R] How to use Subpopulation data?

2009-10-02 Thread Bernardo Rangel Tura
20 SD of value in sample.strat where type is Hypermarket: > sd(sample.strat$value[sample.strat$type=="Hypermarket"] ) [1] 4679.336 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mai

Re: [R] How to use Subpopulation data?

2009-10-01 Thread Bernardo Rangel Tura
gt; > sample.strat > Try: stra<-strata(sampleframe,size=c(20,80,200,300,400),method="srswor") sample.strat<-getdata(sampleframe,stra) sample.strat -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-proje

Re: [R] How to use Subpopulation data?

2009-10-01 Thread Bernardo Rangel Tura
=5000)) > sampleframe=data.frame(type=c(rep("H",100)),value=c(H)) > sampleframe > > str=strata(sampleframe,c("type"),size=c(20,), method="srswor") Try using str=strata(sampleframe,c("type"),size=20, method="srswor") or better str <-

Re: [R] aproximate a titration kurve to the measure data.

2009-10-01 Thread Bernardo Rangel Tura
if you could post it. > > with regards Hi, I think do you need use drc package: drc: Analysis of dose-response curves Analysis of one or multiple curves with focus on concentration-response, dose-response and time-response curves used, for example in biology, environmental sciences,

Re: [R] PCA or CA

2009-09-30 Thread Bernardo Rangel Tura
, in most case I convert numeric variables to factor (with loss of information) and make CA -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

Re: [R] Color index in image function

2009-09-11 Thread Bernardo Rangel Tura
ilan.Pallete(50), legend.lab="Scale") contour(volcano, levels = seq(90, 200, by = 5), add = TRUE) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] Color index in image function

2009-09-10 Thread Bernardo Rangel Tura
mpPalette(c("green","yellow", "blue")) require(fileds) image.plot(volcano, col = Brazilan.Pallete(50), axes = FALSE) contour(volcano, levels = seq(90, 200, by = 5), add = TRUE) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil > > >

Re: [R] Color index in image function

2009-09-07 Thread Bernardo Rangel Tura
tract this color index? > > Thank you > Fir If I understand your question you need change the Palette of image plot. So you need use "colorRampPalette" look my example Brazilan.Pallete <- colorRampPalette(c("green","y

Re: [R] correlation between two 2D point patterns?

2009-08-30 Thread Bernardo Rangel Tura
expect your Euclidean distance is 0, so I suggest this script: dist<-sqrt((x1-x2)^2+(y1-y2)^2) # Euclidean distance t.test(dist) # test for mean equal 0 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-proje

Re: [R] SQL on R

2009-07-05 Thread Bernardo Rangel Tura
but if you think use SQL in your data frames do you use SQLDF (http://cran.r-project.org/web/packages/sqldf/index.html) if you thinks use a database server and access it in R i sugest you use RMySQL (http://cran.r-project.org/web/packages/RMySQL/index.html) -- Bernardo Rangel Tura, M.D,MPH,Ph.D

Re: [R] Convert a lis to matrix

2009-06-07 Thread Bernardo Rangel Tura
> ..- attr(*, "dimnames")=List of 2 > > .. ..$ : chr [1:15364] "6420681" "3610072" "2260458" "60689" ... > > .. ..$ : NULL I'm not sure if understood your question, but look this code a<-list(B=1:3,C=2:4,D=3:5) matrix

[R] Help with a cumullative Hazrd Ratio plot

2009-05-13 Thread Bernardo Rangel Tura
this? In this case with how commands? Thanks in advance! -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] R and McAfee 8.5

2009-05-11 Thread Bernardo Rangel Tura
I appreciate any assistance! > > Warren N. Joyce Hi Joice, In my opinion you need think about 2 things. 1- This is a problem of McAfee 8.5 not a R problem, so do you contact a McAfee support for fix this problem ? 2- I presume you use a windows but i do know your version (XP or Vista or

Re: [R] Division ?

2009-05-03 Thread Bernardo Rangel Tura
t: 952381 is a round number not a real result of division. This occur because R print only 7 significants digits in numbers, if you test > all.equal(21*952380.952380952,2000) [1] TRUE -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil

Re: [R] omit empty cells in crosstab?

2009-04-26 Thread Bernardo Rangel Tura
0 0 0 0 0 1 If you desire use simple code to find only cell>0 use this table(interaction(c,drop=T)) (1,2].(1,2] (2,3].(2,3] (9,10].(9,10] 1 1 1 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil

Re: [R] Dummy (factor) based on a pair of variables

2009-04-18 Thread Bernardo Rangel Tura
EL output ~ I(i-country=="AUT"|j-country=="BEL") -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the p

Re: [R] newbie query: simple crosstabs

2009-04-08 Thread Bernardo Rangel Tura
t; male q1.bin q2.bin q3.bin ... >0 0.6012 0.3421 0.9871 ... >1 0.7121 0.6223 0.0198 ... > > I've tried various combinations of apply & cbind, but to no avail. It would > be easy in SPSS crosstabs, but darnit, I want to use R! Donald, The other solutions is using c

Re: [R] Sequences

2009-04-07 Thread Bernardo Rangel Tura
code is: s<-rep(0,207) s<-as.vector(s) s[0]<-0 for (i in 1:length(lambs)){ s[i]<-s[i-1]-mean(lambs) } But try this code: s<-rep(0,207) s<-as.vector(s) s[1]<-0 # not s[0] for (i in 2:length(lambs)){ #not 1:length(lambs) s[i]<-s[i-1]-mean

Re: [R] How to save the variables in R to a file

2009-04-06 Thread Bernardo Rangel Tura
saves but when I open the file in notepad it is just some characters > meaningless. > > Thank you in advance, > > Kind Regards, > > Aysun Hi Aysun, Try write.csv something like this: write.csv(f.mean.Rdata,"D:/Users/Ays/Documents/Results/f_mean.csv") -- Be

Re: [R] threshold distribution

2009-04-05 Thread Bernardo Rangel Tura
gnormal and density(data) is fine but when I use lines (red) the fit is bad (in attach I send a PDF of my output) Do you know why this happen? Thanks in advance -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil P.S. my script is x <- scan() 0.80010 0.72299 0.6

Re: [R] Installation of all packages under Unix

2009-04-02 Thread Bernardo Rangel Tura
job at startup. > > Something like R cmd install -l pkgs ### where pkgs should mean all > packages (is there an option to control overwriting?) > > Thanks a lot, > > N. Boehme All packages in CRAN install.packages(new.packages(),dep=T,clean=T) -- Bernardo Rangel Tura

Re: [R] A query about na.omit

2009-04-01 Thread Bernardo Rangel Tura
nomic Research Institute of Northern Ireland > Hi Jose Luis, I think this script is sufficient for your problem: tab<-matrix(c(1,1,1,2,2,2,3,3,NA,4,NA,4,NA,5,5),ncol=3,byrow=T) tab[!is.na(tab[,1])&!is.na(tab[,2]),] -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology

Re: [R] how to increase the limit for max.print in R

2009-03-31 Thread Bernardo Rangel Tura
ompiled R 2.8.1 in AMD phenom using Ubuntu 8.10 AMD 64 > .Machine$double.xmax [1] 1.797693e+308 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/

Re: [R] how to increase the limit for max.print in R

2009-03-31 Thread Bernardo Rangel Tura
nd, something like this options(max.print=5.5E5) For more information type? ?options -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] very fast OLS regression?

2009-03-26 Thread Bernardo Rangel Tura
lm.fit(x, y) : NA/NaN/Inf in foreign function call (arg 1) Timing stopped at: 0 0 0.001 So routines ols2, ols3 and ols4 only functional in fully matrix if have one NA this functions don't run. -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __

Re: [R] Search "Errors"

2009-03-25 Thread Bernardo Rangel Tura
ce, browser and debug. In special cases i use a debug package ( http://cran.r-project.org/doc/Rnews/Rnews_2003-3.pdf ) Article: Debugging without (too many) tears -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r

Re: [R] any package for connecting berkeley db in R?

2009-03-23 Thread Bernardo Rangel Tura
On Fri, 2009-03-20 at 17:23 -0400, Zheng, Xin (NIH) [C] wrote: > Hi there, > > Is there any such package? I searched but found none. Thanks in advance. > > Xin Zheng > Hi Xin Do you try package DBI? -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of

Re: [R] fisher.test - FEXACT error 7

2009-03-23 Thread Bernardo Rangel Tura
lls have counts at least 5. 3- Use "large tables" approach from Sir David Cox: Law, G. R. and Cox, D. R. and Machonochie, N. E. S. and Simpson, J. and Roman, E. and Carpenter, L. M. (2001) Large tables. Biostatistics 2(2):pp. 163-171. -- Bernardo Rangel Tura, M.D,MPH,Ph.D National In

Re: [R] numeric equality

2009-03-20 Thread Bernardo Rangel Tura
;- 1 - 0.8 > > > a == 0.2 > > [1] FALSE Hi Yu, First of all read FAQ 7.31 (Why doesn't R think these numbers are equal?) Second, in this case, use all.equal a <- 1 - 0.8 a == 0.2 [1] FALSE all.equal(a,0.2) [1] TRUE -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institut

Re: [R] Regressão linear

2009-03-06 Thread Bernardo Rangel Tura
lt;- lapply(splitdata,lm,formula=y~x) > coefs <- sapply(linfits,coef) > > or something like that. > > Ben Bolker Hi Ben Bolker First of all I would like to thank the kindness with my countrywoman. Second in her problem each 6 rows is a subset for a linear regression s

Re: [R] density > 1?

2009-03-02 Thread Bernardo Rangel Tura
98 0.2800 0.9400 1.9800 2.6000 4. [7] 4.0400 2.9200 1.6600 0.9200 0.4400 0.1000 [13] 0.0200 set.seed(123) sum(hist(rnorm(1000,sd=.1),freq=FALSE)$density) [1] 1 So the sum of probability is 1 but the sum of density 20 --

Re: [R] rounding problem

2009-03-02 Thread Bernardo Rangel Tura
utine put a bias in your analysis 2- Is not a standard (check IEC 60559 about this) 3- Do you migrating a excell bug to R -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://sta

Re: [R] Does The Randvar package contain a virus(Malware) ?

2009-03-02 Thread Bernardo Rangel Tura
etails/id_vir/4142/heur_html.malware.html HEUR/HTML.Malware Not a virus but a code this anti virus suspected may be a virus -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://sta

Re: [R] 1.095e+09 for integers

2009-02-23 Thread Bernardo Rangel Tura
ientific=FALSE) [1] "12345678912345678 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] System of logistics Equations-correction

2009-02-20 Thread Bernardo Rangel Tura
ime to obtain estimatives of effects and uncorrelated error terms. The systemfit package fit linear system and non-linear system but is possible adjust a logistic system in R? Thanks in advance -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil ___

[R] System of logistics Equations

2009-02-20 Thread Bernardo Rangel Tura
tives of effects and uncorrelated error terms. The systemfit package fit linear system and non-linear system but is possible adjust a logistic system in R? Thanks in advance -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil ___

Re: [R] Generating Numbers With Certain Distribution in R

2009-02-11 Thread Bernardo Rangel Tura
blem more > precisely (and perhaps give some context) if you want > a better answer ... > > Ben Bolker Ben, I think your routine need a little fix x <- rlnorm(1e6,meanlog=1,sdlog=1) ## pick any parameters you like y <- round((x-min(x)/diff(range(x)))*19+1) What you thin

Re: [R] OT: A test with dependent samples.

2009-02-11 Thread Bernardo Rangel Tura
, so i think de priori is a beta (1[0+1],73[72+1]). The likelihood is oblivious beta(13[12+1],61[60+1]) So the posteriori is beta(1,73)*beta(13,61)=beta(14,134) The expected valeu of posteriori is 0.1 in 72 cats is same 7.2 or 7 CATS is almost a half of numbers of study. -- Bernardo Rangel Tur

Re: [R] Choosing a random number between x and y

2009-02-10 Thread Bernardo Rangel Tura
xamples Using runif 1- Random 10 number Retween 0 and 0.5 runif(10,0,0.5) 2 -Random 20 number Retween 0 and 0.7 runif(20,0,0.7) 3- Random 40 number of mixture two random uniforme random 1 and 2 with p(random1)= 0.3 and p(random=2) = 0.7 ifelse(runif(40)>.3,runif(40,0,0.7),runif(40,0,0.5)) --

Re: [R] How to analyse and model 2 time series, when one series needs to be differenced?

2009-02-01 Thread Bernardo Rangel Tura
ome hints. > > > Regards, > Andreas. Hi Andreas, If I understand your problem this script solve tour question t<-1:15 x<-rnorm(10) y<-.2-.3*t+rnorm(15) y.dif<-diff(y,1) ccf(x,y.dif) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil _

Re: [R] R for Computational Neuroscience?

2009-01-25 Thread Bernardo Rangel Tura
l (DTI). This includes the calculation of anisotropy measures and, most important, the implementation of our structural adaptive smoothing algorithm as described in K. Tabelow, J. Polzehl, V. Spokoiny, and H.U. Voss, Diffusion Tensor Imaging: Structural Adaptive Smoothing, Neuroimage 39(4), 1763-1773 (2

Re: [R] Is it possible for R to import a SigmaPlot file?

2009-01-23 Thread Bernardo Rangel Tura
abase for other type of files. If you export jnb file to csv file is possible read a database in R. I will talk with a person work with me and tonight I send other mail with more details. -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __

Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Bernardo Rangel Tura
Function3.txt) ... source(MyFunctionn.txt) } -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] pchisq error

2009-01-19 Thread Bernardo Rangel Tura
EASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base Well, do you already try update your R? -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil _

Re: [R] How-To capture and handle errors with R

2008-12-14 Thread Bernardo Rangel Tura
. > > Thank you so much, > Maura Maura you can use try to catch error for more information digit: ?try -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Logical inconsistency

2008-12-11 Thread Bernardo Rangel Tura
of significant digits for comparison. In all example put in this thread we need only 1 decimal place so you round for 1 decimal place, if for your job you need 3 decimal places precision you round for 3 decimal place. I think don't make sense you using 10 decimal place precision if your pr

Re: [R] Logical inconsistency

2008-12-11 Thread Bernardo Rangel Tura
culation: Look this > round(8.8,1)-round(7.8,1)>1 [1] TRUE > round(8.8-7.8,1)>1 [1] FALSE > round(8.8-7.8,1)==1 [1] TRUE Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil -- Original Message --- From: "Kenn Konstabel" <[EMAIL PROTE

Re: [R] Logical inconsistency

2008-12-10 Thread Bernardo Rangel Tura
; 1 > >FALSE > > 11.3 - 10.3>1 > > FALSE > > Emma Jane Emma, This solve two forms: 1- use all.equal > all.equal((10.2 - 9.2),1) [1] TRUE 2- use round > round(10.2 - 9.2,0)>1 [1] FALSE > round(10.2 - 9.2,0)>=1 [1] TRUE -- Bernardo Rangel Tura,

Re: [R] Logical inconsistency

2008-12-06 Thread Bernardo Rangel Tura
ally here is a consequence of its > implementation of floating point arithmetic. > > the faq you were pointed to, and its referring to the goldberg's > article, show that r does not successfully isolate a user from details > of the lower-l

Re: [R] how to ignore errors

2008-12-01 Thread Bernardo Rangel Tura
stochastically wrong,i.e., sometimes it works well if > no bad values return. > I want to know how to ignore such errors and let the loop continue. > > thanks in advance. > ___ > Jiang Peng, The default solution is using try command, something like this

Re: [R] help for code in jump diffusion

2008-11-22 Thread Bernardo Rangel Tura
t;-qnorm(m,0,1) S0<-abs(S0*((1+mu*dt+sig*sqrt(dt)+ gam)- j*theta)) if(!is.nan(S0)&&(S0 <= 0)){ warning("S0 must be positive") cat("NaN","\n") } cat(S0,"\n") i<-i+(1/252) }

Re: [R] Mismatch in logical result?

2008-11-07 Thread Bernardo Rangel Tura
On Fri, 2008-11-07 at 15:53 +0530, Shubha Vishwanath Karanth wrote: > > Hi R, > > > > I have certain checkings, which gives FALSE, but actually it is true. Why > does this happen? Note that the equations that I am checking below are not > even the case of recurring decimals... > > > > >

Re: [R] How to plot with different colours

2008-11-02 Thread Bernardo Rangel Tura
unif(6000,-1,1) color<-ifelse(x>.35,"green",ifelse(x< -.35,"red","yellow")) table(col) plot(1:6000,x,col=color) -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.or

Re: [R] group sequential analysis - stopping for futility

2008-10-30 Thread Bernardo Rangel Tura
lop this code with you . Do you have a paper about this? -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://ww

Re: [R] Installing R in Linux: problems with JAVA packages (rJava, RWeka, ...) ?

2008-10-21 Thread Bernardo Rangel Tura
(...) Hi Paulo I think you need install JDK and JRE for using rJava -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] about "granova" library

2008-10-20 Thread Bernardo Rangel Tura
t? > > I’m using a Windows Vista system and I have the R version 2.7.2. > > Cheers, > > Fer Fernando I using R version 2.7.2 and Ubuntu 8.04 in my computer: granova.1w - runs fine granova.2w - don't run fine, actual only 1 of 2 graphical windows apear a plot (rgl sur

Re: [R] Saving results of Kruskal Walis test

2008-10-16 Thread Bernardo Rangel Tura
ble (It works > very well saving results from anova analysis) or is there any other way to > save results in a file for future use.. > > Thanks > Himanshu Hi Himanshu Well the output of htests is a list so data_file.out is a lista to. You don't put a list ins a data.frame so you

Re: [R] help about how can R compute AIC?

2008-10-15 Thread Bernardo Rangel Tura
32.7599+2*(p+1) # # this is very important the model have two # parameter, because sigma is a parameter to. # so # AIC= 32.7599+2*(2+1) AIC= 32.7599+6 AIC= 38.7599 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-h

Re: [R] legend

2008-10-15 Thread Bernardo Rangel Tura
> > legend("bottom",legend=paste("Sigma1=", c(0.01,0.1,0.2,0.5,1,1.5,2,4,6,9.5), > sep=""), > fill=c("red","green","blue","black","pink","brown","purple","yellow","lig

Re: [R] interpreting Shapiro-Wilks test result

2008-10-11 Thread Bernardo Rangel Tura
level of test. What exist is confidence level of your experiment. If you plan your experiment with alpha probability you have 100*(1-alpha) confidence level and you p-value need minor than alpha to named "significant" So if you need 99% of significance the two groups is normal and you using t.tes

Re: [R] Load a program at the front end

2008-10-06 Thread Bernardo Rangel Tura
Em Qui, 2008-10-02 às 14:36 -0400, Gang Chen escreveu: > I want to run a R program, prog.R, interactively. My question is, is > there a way I can start prog.R on the shell terminal when invoking R, > instead of using source() inside R? > > TIA, > Gang Hi Gang I my system just only type: R --n

Re: [R] cannot open connection: Authorization Required

2008-10-05 Thread Bernardo Rangel Tura
> > [20] "here is the contents page of the R > Project's" > [21] "website." > > [22] "" >

Re: [R] Logistic regression problem

2008-10-01 Thread Bernardo Rangel Tura
Em Ter, 2008-09-30 às 18:56 -0500, Frank E Harrell Jr escreveu: > Bernardo Rangel Tura wrote: > > Em Sáb, 2008-09-27 às 10:51 -0700, milicic.marko escreveu: > >> I have a huge data set with thousands of variable and one binary > >> variable. I know that most of the varia

Re: [R] Logistic regression problem

2008-09-30 Thread Bernardo Rangel Tura
ood > predictor... > > Any suggestion is welcomed milicic.marko I think do you start with a rpart("binary variable"~.) This show you a set of variables to start a model and the start set to curoff for continous variables -- Bernardo Rangel Tura, M.D,MP

Re: [R] birthday problem (factorial limit)

2008-09-30 Thread Bernardo Rangel Tura
lculate factorials up > to 170. > > > So is there a way to push that limit? > > to solve this formula: > > (factorial(365) / factorial((365-23))) / (365^23) > > (n=23) Log experession n<-23 exp(sum(log(1:365))-sum(log(1:(365-n)))-n*log(365)) [1] 0.492

  1   2   >