Re: [R] Resshufling algorithm (Thiago Souza)

2008-07-19 Thread Bernardo Rangel Tura
Thiago, If I understood your problem do you solve using sample, look this example data<-rep(letters[1:6],10) sample<-sample (data,10) sample table(sample) sample<-sample (data,10) sample table(sample) For repeat the sample using "for" for (i in 1:1)

Re: [R] calculate differences - strange outcome

2008-07-20 Thread Bernardo Rangel Tura
ot;guard digits" approach, so if you needd solve: 865.56-(782.86+0+63.85+18.85+0) Using 865.56/100 -(782.86+0+63.85+18.85+0)/100 More details in http://docs.sun.com/source/806-3568/ncg_goldberg.html (This links is indicated in R FAQ 7.31) -- Bernardo Rangel Tura, M.D,

Re: [R] boxplot help

2008-08-03 Thread Bernardo Rangel Tura
;Mean",i,sep="-") savePlot(filename = title,type = c("png")) } OR for(i in 1:length(all.the.mean){ windows() title<-paste(i,"png",sep=".") png(filename =tilte) boxplot(all.the.mean[[i]] dev.off() } -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institu

Re: [R] error in installing R packages

2008-08-07 Thread Bernardo Rangel Tura
x27; > > > > The downloaded packages are in > > /tmp/RtmpZ0Gndg/downloaded_packages Eva, Sorry but you type "sudo R" to invoke R ? -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R

Re: [R] Tcl\tk not supported on this system

2008-08-11 Thread Bernardo Rangel Tura
es of tcl/tk. I ubbuntu - debian packages - exists 2 packagas for tcl (tcl8.? and tcl8.?-dev) and 2 packages for tk (tk8.? and tk8.?-dev) In your system also exist 2 packagas tcl-8.4.7-2 and tcl-devel-8.4.7-2 I thinks if you install tcl-devel and tk-devel packages you solve your prob

Re: [R] Comparison of demographics between 2 study samples

2008-08-14 Thread Bernardo Rangel Tura
Em Qua, 2008-08-13 às 19:14 -0700, Mark Home escreveu: > Dear All: > > I have a clinical study where I would like to compare the demographic > information for 2 samples in a study. The demographics include both > categorical and continuous variables. I would like to be able to say whether > t

Re: [R] Confidence Interval

2008-08-20 Thread Bernardo Rangel Tura
ou don't use "ci.examp" of "TeachingDemos" package? It's a very good example -- 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/l

Re: [R] Interpreting Logistic Regression

2008-08-23 Thread Bernardo Rangel Tura
t; (b) How do I interpret the "R" result as given below? I know all the > variables are significant. How do I get Log Likelihood ratio, Odds ratio etc.? well odds ratio: model<- glm (formula,family=binomial) exp(coef(model)) Log Likehood model$deviance -- Bernardo Rangel Tura, M.D,M

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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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] "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] 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] 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] 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

[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] 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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[R] Complex Time Series

2008-06-18 Thread Bernardo Rangel Tura
seasonal ma(1) is simple using command arima for fit a time serie, but I don't know HOW TO fit a arima model in a time serie with 2 diferent seasonal periods I attach de file ts.csv with the serie. Thanks in advance.... Bernardo Rangel Tura, M.D, M.P.H, PhD National Institute of Cardiolog

Re: [R] Ignore blank columns when reading a row from a table

2008-07-06 Thread Bernardo Rangel Tura
he NAs. Is there a way to ignore > the > empty columns? > > Thanks, > -Nina Nina You can use scan() and argument what, if necessary you can use the argument fill=T to solve a diferent coluns length. use ?scan to get help -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Insti

Re: [R] Simulating Conditional Distributions

2008-03-25 Thread Bernardo Rangel Tura
5)) W1<-ifelse(Y==0,1,rbinom(n, 1, .2)) W2<-ifelse(Y==0,1,runif(n, min = 3, max = 8)) W3<-ifelse(Y==0,1,rnorm(n, mean=0, sd=2)) pop<-data.frame(Y,A,W1,W2,W3) pop -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R

Re: [R] biplot

2007-11-20 Thread Bernardo Rangel Tura
t; center automatically. How to disable this? > > Thanks Hi WeiWei To solve your problem you must use the options xlim, ylim in your biplot par(mfrow=c(2,1)) biplot(...,xlim=c(minimun,maximun),ylim=c(minimun,maximun),...) biplot(...,xlim=c(minimun,maximun),ylim=c(minimun,maximun),...) --

Re: [R] Naming elements of a list

2007-11-22 Thread Bernardo Rangel Tura
list(i)) : all elements of a list must be named > > > -- > > Is there an easy way to name all elements of a list? > > Your advice? Hi Tom, If I understand your question is possible solve yours problem with this co

Re: [R] testing independence of categorical variables

2007-11-26 Thread Bernardo Rangel Tura
using chisq.test(table(x,y)). If you using chisq.test(x,y) R will testing goodness-of-fit. -- Bernardo Rangel Tura, M.D,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] problem with plotting table

2007-11-28 Thread Bernardo Rangel Tura
mes(table(x))), type="p") points(as.numeric(names(table(y))), pch=2) OR x<-1:10 y<-x/2 plot(x, type="p") points(y, pch=2) If you need more help send a mail -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __

Re: [R] intercept in multiple regression

2007-11-30 Thread Bernardo Rangel Tura
mula = y - 1 ~ x2 - 1) Coefficients: x2 -0.03041 Your regression is y-1=-0.03041*x2 or y=1-0.03041*x2 -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] Is R portable?

2007-12-04 Thread Bernardo Rangel Tura
Well, yesterday I put a linux version of R 2.6.0 in a USB stick of 2Gb and it runs very well... Bernardo Rangel Tura, MD,MPH,Phd National Cardiology Institute -- Original Message --- From: John Kane <[EMAIL PROTECTED]> To: Roland Rau <[EMAIL PROTECTED]>, Tom Ba

Re: [R] level significance

2007-12-09 Thread Bernardo Rangel Tura
0.059439 0.083823 0.7090.479 Fc:x 0.003769 0.082373 0.0460.964 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (...) In this case only the Intercept is significant -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil

Re: [R] CART analysis

2007-12-10 Thread Bernardo Rangel Tura
andard formula Any doubt read : http://cran.r-project.org/doc/packages/tree.pdf and 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-help

Re: [R] the observed "log odds" in logistic regression

2007-12-10 Thread Bernardo Rangel Tura
lp you send a small part of your data and a reproductive example to us because is more easy understand your question this way -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@r-project.org mailing list https://stat.et

Re: [R] Non-Linear Quantile Regression

2008-01-02 Thread Bernardo Rangel Tura
iable, dependent variable) So based in this plot you choose de formula of your data > > At last, one confirmation: Can I run log X log analysis in nlrq?? > > Please, I need very much any response, as I don't know what make in this > moment... > > Thank you very much

[R] Multiple correspondence analysis

2008-01-13 Thread Bernardo Rangel Tura
ows = F) Don't work and result in a error: Error in svd(X) : infinite or missing values in 'x' Where I worng? Anybody help me? Thanks in advance -- Bernardo Rangel Tura, M.D,MPH,Ph.D National Institute of Cardiology Brazil __ R-help@

Re: [R] question regarding hypothesis testing in contingency tables

2008-01-13 Thread Bernardo Rangel Tura
% of scared dogs form sample b? I would like something like > the "adjusted standardized reziduals" test from SPSS? (...) > Thank you and have a great day! Hi Eugen! The adjusted standardized residuals is available in package gmodels require(gmodels) ?CrossTable -- Bernardo R

Re: [R] cannot allocate memory

2008-09-24 Thread Bernardo Rangel Tura
10.1 407500 21.8 188951 10.1 Vcells 168893 1.3 786432 6.0 168893 1.3 If you read gc help: reset: logical; if 'TRUE' the values for maximum space used are reset to the current values. Other issue is options for rgui command. Have a option "--max-mem-size"

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

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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

  1   2   >