Re: [R] Help with R

2010-10-15 Thread peter dalgaard
-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https

Re: [R] Error in eval(expr, envir, enclos) : object 'x' not found

2010-10-16 Thread Peter Dalgaard
not be intended to use the same data as used for prediction). -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] Poisson Regression

2010-10-16 Thread Peter Dalgaard
.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Variable name as string

2010-10-17 Thread Peter Dalgaard
, no, it isn't. Your SE formula only holds when var is the only predictor. It would be more general to extract the SE from coefficients(summary(lm.result)) (which also avoids having to pass var as an argument). -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd

Re: [R] Variable name as string

2010-10-17 Thread Peter Dalgaard
=FALSE) } } -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Milliseconds and Time object

2010-10-19 Thread peter dalgaard
be safer to standardize on GMT (just add tz=GMT to the as.POSIXct() call.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] wilcox.test; data type conversion?

2010-10-30 Thread Peter Dalgaard
was generated. The argument to the default method is a matrix and the row/col ordering determines the plot. If, in turn, it was created by tabulating two factors, then factor level ordering (by default alphabetic) applies to the table. -- Peter Dalgaard Center for Statistics, Copenhagen Business School

Re: [R] wilcox.test; data type conversion?

2010-10-30 Thread Peter Dalgaard
only 3 females in 9 students, you can get ambitious and set up the permutation distribution by enumerating the choose(9,3)=84 possible outcomes.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Display of NAs in character columns of a data frame under fix() or edit().

2010-11-02 Thread Peter Dalgaard
seem to have gotten stuck in indecision about which graphical toolkit to use. The Rcmdr has a data viewer (but not editor) written with the Tcl/Tk interface, which might be a starting point. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd

Re: [R] problem with RODBC installation

2010-11-04 Thread Peter Dalgaard
a development package is missing, but exactly which one depends on your particular flavour of Linux. In Fedora 13, it is here: $ rpm -qf /usr/include/sqlext.h unixODBC-devel-2.2.14-12.fc13.i686 so the unixODBC-devel package is required. In e.g. Ubuntu, it is -er- somewhere else... -- Peter Dalgaard

Re: [R] score test for logistic regression

2010-11-14 Thread peter dalgaard
commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org

Re: [R] stacking consecutive columns

2010-11-18 Thread peter dalgaard
, decreasing=FALSE),] } x - do.call(cbind, v) write.table(x,clipboard,sep= ,col.names=NA) #export to Excell via Ctrl-V Just wondering, was anything wrong with y1 - cbind(yearmonth[,-1], foo = NA) names(y1) - names(yearmonth) rbind(yearmonth, y1) ? (untested, of course) -- Peter Dalgaard

Re: [R] Why do I get (not estimable) in this aov data

2010-11-30 Thread peter dalgaard
would take more than 16 observations! I suspect that aov() is simply the wrong tool for these data. lm() will do it, but watch out for the aliased effects. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501

Re: [R] Wilcox.test U values

2010-07-14 Thread Peter Dalgaard
computers...) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] How to define a function (with '-') that has two arguments?

2010-07-14 Thread Peter Dalgaard
to an assignment function must be called value, not z. Beware though, that the code may still not do what you think it should do (e.g., the return value for an assignment function REPLACES the first argument). -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501

Re: [R] Query about wilcox.test() P-value

2010-07-14 Thread Peter Dalgaard
that this at least partly originates in times when we were less careful about computing the appropriate tail of test statistic distributions. So one main point was that a p-value of 0 could arise as 1 minus a number very close to 1. -- Peter Dalgaard Center for Statistics, Copenhagen Business School

Re: [R] How to see the process of function sample()?

2010-07-14 Thread Peter Dalgaard
the sources. R News, 6(4):43-45, October 2006. http://cran.r-project.org/doc/Rnews/ -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https

Re: [R] Matrix Size

2010-07-14 Thread Peter Dalgaard
-1 = ca. 2 trillion elements. Yes, you could be doing it wrong, but what is it? If the matrix is sparse, there are sparse matrix tools around... -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Matrix Size

2010-07-15 Thread Peter Dalgaard
paul s wrote: On 07/14/2010 06:15 PM, Peter Dalgaard wrote: A quick calculation reveals that a matrix of that size requires about 2.7 TERAbytes of storage, so I'm a bit confused as to how you might expect to fit it into 16GB of RAM... However, even with terabytes of memory, you would

Re: [R] how to comment off sections

2010-07-17 Thread Peter Dalgaard
version of) ESS. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] how to collapse categories or re-categorize variables?

2010-07-17 Thread Peter Dalgaard
for(i in seq_along(dat))...) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] Namibia becoming NA

2010-07-18 Thread Peter Dalgaard
write.csv) probably precludes changing anything at this point. Notice that read.csv and friends do pass ... to read.table, so it is easy to override the default setting. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] question about sign of probit estimates

2010-07-20 Thread peter dalgaard
deleted]] __ 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.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter

Re: [R] Correct statistical inference for linear regression models without intercept in R

2010-07-20 Thread peter dalgaard
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] how to force a table to be square?

2010-07-22 Thread peter dalgaard
-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg

Re: [R] Question about a perceived irregularity in R syntax

2010-07-22 Thread Peter Dalgaard
. NA and NA are very different things 2. checkout is.na() and its help page -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https

Re: [R] Mathematical expression

2010-07-22 Thread Peter Dalgaard
). r2string = expression(paste(r^2), = , r2); Any help would be greatly appreciated, Phil r2string = substitute(r^2 == r2, list(r2=r2)) or bquote(r^2==.(r2)) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] , how to express bar(zeta) in main title in boxplot

2010-07-22 Thread Peter Dalgaard
), list(x=quote(2+2 vs. eval(substitute(I(x), list(x=expression(2+2 Nice example of a real-life case of this effect, hang on to it and we can dig to the bottom of it some other time. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd

Re: [R] package for rank ordered logit

2010-07-26 Thread Peter Dalgaard
) ==. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] how to generate a random data from a empirical distribition

2010-07-27 Thread Peter Dalgaard
ultimate goal is to generate addition 20,000 data point from this empirical distribution created from the existing 10,000 data points. thank you all in advance. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] the real dimnames

2010-07-27 Thread Peter Dalgaard
... with(airquality,table(Month)) Month 5 6 7 8 9 31 30 31 31 30 -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch

Re: [R] how to get higher derivatives with deriv

2010-07-30 Thread peter dalgaard
an order argument is left as an exercise, because I'm too lazy) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r

Re: [R] how to get higher derivatives with deriv

2010-07-30 Thread peter dalgaard
) { for (i in 2:order) { body(ddf) - D(body(ddf),x) } } ddf } Yes. One thing: body() and body-() are relatively expensive operations, and only really needed on the way in and the way out, so you might want to use a temporary variable. -- Peter

[R] Next release of R planned to be 2.12.0

2010-07-30 Thread Peter Dalgaard
This mainly as a thumbs-up to sysadmins planning installation for the Fall semester: Only a small number of low-impact bugs have been found since the 2.11.1 release so we have decided NOT to do a 2.11.2, but head straight for 2.12.0 some time in October. For the R Core Team Peter Dalgaard

Re: [R] logos and goodies

2010-07-30 Thread peter dalgaard
guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] R on Mac OS X 10.6 freezing up

2010-07-30 Thread Peter Dalgaard
could (say) connect to the R process and do a traceback showing where things get stuck. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org

Re: [R] Is profile.mle flexible enough?

2010-08-01 Thread Peter Dalgaard
necessary here as the calculation of N will automatically force evaluation of x, but forgetting to do it can cause some rather magnificent grief otherwise because of R's lazy evaluation mechanisms.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd

Re: [R] Specify contrasts in R

2010-08-02 Thread peter dalgaard
-1.00 [3,] -0.50 1.00 0.00 -0.50 [4,] -0.50 0.00 1.00 -0.50 So, no, you guessed incorrectly. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] read SAS dataset using read.ssd()

2010-08-03 Thread Peter Dalgaard
the .ssd01 file from SAS at all (I believe there's an Import menu somewhere). If you cannot, then R won't be able to help, if you can, there's an obvious workaround in saving it back as .sas7bdat. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd

Re: [R] Confidence Bands in nonlinear regression using optim and maximum likelihood

2010-08-03 Thread Peter Dalgaard
/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org

Re: [R] Problems with normality req. for ANOVA

2010-08-03 Thread peter dalgaard
/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email

Re: [R] Kruskal Walllis test

2010-08-03 Thread peter dalgaard
. __ 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.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen

Re: [R] Using '[' as a function

2010-08-04 Thread peter dalgaard
for functions was retained for compatibility.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org

Re: [R] split / lapply over multiple columns

2010-08-05 Thread Peter Dalgaard
of a giveaway... -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Is R GPL or LGPL (or can I write a commercial front end to R)?

2010-08-06 Thread peter dalgaard
/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Peter Dalgaard
, that is; it's not true for the identity link, obviously.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Confidence Intervals for logistic regression

2010-08-07 Thread Peter Dalgaard
of the same order as that caused by the discrete distribution of the response, so it is not like one method is going to win by orders of magnitude. Michael -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Problem with installing a package in R!

2010-08-09 Thread Peter Dalgaard
if an installation terminates prematurely. Do you have the appropriate permissions? It ia not clear to me whether that is supposed to be a user-level library or a system one. Is your user name ubuntu? (And is ubuntu really still shipping 2.9.x?) -- Peter Dalgaard Center for Statistics, Copenhagen

Re: [R] Difference Between R: wilcox.test and STATA: signrank

2010-08-09 Thread peter dalgaard
the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] Identifying integers (as opposed to real #s) in matrix

2010-08-10 Thread peter dalgaard
On Aug 10, 2010, at 10:13 AM, Romain Francois wrote: rowSums( x == round(x) ) == ncol(x) [1] TRUE FALSE TRUE FALSE For later readability, I think I'd prefer apply(x==round(x), 1, all) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000

Re: [R] package for measurement error models

2010-08-10 Thread peter dalgaard
(). -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] one (small) sample wilcox.test confidence intervals

2010-08-10 Thread peter dalgaard
has if (achieved.alpha - alpha alpha/2) { warning(Requested conf.level not achievable) conf.level - 1 - signif(achieved.alpha, 2) } so I have to assume that the author has considered this with some care. -- Peter Dalgaard

Re: [R] influence measures for multivariate linear models

2010-08-10 Thread Peter Dalgaard
, but I'm afraid my time is too constrained at them moment for more than a sideline view.) -Michael -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Peter Dalgaard
whether I looked at the Passing-Bablok paper at the time (1985!!) but my general recollection is that this group of methods is littered with unstated assumptions.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Plotting confidence bands around regression line

2010-08-11 Thread peter dalgaard
applied to (x-a1,y) and interpolate between them. -- Michal J. Figurski, PhD HUP, Pathology Laboratory Medicine Biomarker Research Laboratory 3400 Spruce St. 7 Maloney Philadelphia, PA 19104 tel. (215) 662-3413 On 2010-08-10 13:12, Peter Dalgaard wrote: Michal Figurski wrote

Re: [R] help usin scan on large matrix (caveats to what has been discussed before)

2010-08-12 Thread peter dalgaard
guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] help usin scan on large matrix (caveats to what has been discussed before)

2010-08-12 Thread peter dalgaard
of dimensions On 8/12/2010 12:24 PM, peter dalgaard wrote: On Aug 12, 2010, at 11:30 AM, Martin Tomko wrote: c-scan(file=f,what=list(c(,(rep(integer(0),cols, skip=1) m-matrix(c, nrow = rows, ncol=cols,byrow=TRUE); for some reason I end up with a character matrix, which I don't want

Re: [R] help usin scan on large matrix (caveats to what has been discussed before)

2010-08-12 Thread Peter Dalgaard
) with matrix. Apologies to naive questions, I am a newbie, in principle. At this point I think you need to actually try my suggestions, and maybe read the documentation again. Explaining how you have misunderstood the documentation is not going to help... -- Peter Dalgaard Center for Statistics

Re: [R] Games

2010-08-13 Thread peter dalgaard
your solution certainly doesn't work! I see 10 games in the 10th round, all involving team K. That's not how to arrange a tournament! -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk

Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread peter dalgaard
commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r

Re: [R] Games

2010-08-13 Thread peter dalgaard
for (j in t0:(t0+n-1)) { k - k+1 time[k] - (j-1) %% 10 + 1 } } Shouldn't there be 11 rounds? This way you have one team playing twice in every round. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501

Re: [R] Games

2010-08-13 Thread peter dalgaard
On Aug 13, 2010, at 5:15 PM, peter dalgaard wrote: On Aug 13, 2010, at 4:45 PM, Michael Bedward wrote: teams - LETTERS[1:11] matches - combn(teams, 2) draw - data.frame(team1=matches[1,], team2=matches[2,]) # someone will know how to do this in one line... time - numeric(55) k - 0

Re: [R] hypergeometric vs fisher.test

2010-08-13 Thread Peter Dalgaard
-06 -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Bug in t.test?

2010-08-13 Thread Peter Dalgaard
that the differences he observed are, shall we say, obscure! Did you miss the point that the incorrect behaviour with na.exclude is the default one? (Actually, na.omit is, but the effect is the same). Arguably, t.test could just hardcode na.action=na.pass and begone with it. -- Peter Dalgaard

Re: [R] How to perform a substitution in a loop?

2010-08-14 Thread Peter Dalgaard
not telling us Possibly that x is not a vector (a data frame, maybe?). (And it's wrong is not one of the official error messages in any language. Posting guide, reproducible code, etc.) The whole thing is an inefficient way to do x - pmin(x,1), though. -- Peter Dalgaard Center

Re: [R] How to perform a substitution in a loop?

2010-08-14 Thread Peter Dalgaard
, thus it need a TRUE/FALSE is there any command to replace the NaN value with 1 in an efficient way? Usually, you'd safeguard the if with if (is.na(x[i]) || x[i] 1)... or if (!is.na(...) ...), depending on what you want. BTW, notice also that pmin has an na.rm argument. -- Peter Dalgaard

Re: [R] Stepwise Regression + entry/exit significance level

2010-08-14 Thread Peter Dalgaard
to modify the step function to do it, though; all the building blocks would seem to be there. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org

Re: [R] Re : Difference in Monte Carlo calculation between chisq.test and fisher.test

2010-08-14 Thread Peter Dalgaard
__ 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.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School

Re: [R] Relation 1.5*IQR/Percentile in case of a normal Distribution

2010-08-14 Thread Peter Dalgaard
(). pnorm(4*qnorm(.75), lower=F) # Q3 + 1.5 IQR = 4 Q3 since IQR = 2 Q3 [1] 0.003488302 gives the tail probabilities of .35%, and the rest is by definition. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Paired t-tests

2010-08-15 Thread Peter Dalgaard
puzzled by the fact that there are 15DF in both cases, but different average difference. This kind of suggests to me that maybe the x and y are not computed correctly. (If only the ordering was scrambled, the average difference should be the same, but the variance typically inflated.) -- Peter

Re: [R] as.logical(factor) behaviour

2010-08-15 Thread Peter Dalgaard
and see what happens: as.logical.factor - function(x)as.logical(levels(x))[x] as.logical(factor(0)) [1] NA as.logical(factor(FALSE)) [1] FALSE as.logical(factor(TRUE)) [1] TRUE as.logical(factor(1)) [1] NA as.logical(0) [1] NA -- Peter Dalgaard Center for Statistics, Copenhagen Business

Re: [R] Fwd: as.logical(factor) behaviour

2010-08-15 Thread Peter Dalgaard
, so there's not likely to be that much of a problem with reinstating that behaviour. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing

Re: [R] Strategy for maintaining R in student PC labs

2010-08-16 Thread peter dalgaard
deleted]] __ 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.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter

Re: [R] A question of install R packages

2010-08-17 Thread Peter Dalgaard
. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Odd crash with tcl/tk

2010-08-17 Thread peter dalgaard
, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Weird differing results when using the Wilcoxon-test

2010-08-18 Thread peter dalgaard
) because of symmetry and the fact that the sum of all N ranks is fixed.) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] dimnames

2010-08-18 Thread Peter Dalgaard
On 08/18/2010 06:20 PM, Joshua Wiley wrote: matrix(1:4, nrow = 4, ncol = 1, dimnames = list(NULL, true value)) or even cbind(true value=1:4) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Yet another memory limit problem

2010-08-18 Thread Peter Dalgaard
, it does look odd that mydat with dimensions 245x9 should generate an 800M memory request. As others have suggested, perhaps mydat is not what you think it should be... -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] R reports

2010-08-19 Thread peter dalgaard
, ... -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Problem Installing R-Commander

2010-08-20 Thread Peter Dalgaard
enough, when I look fBasics in missing. Please advise. Norton antivirus software has been reported to cause this type of error. Rcmdr has nothing to do with it per se (except that it generates a large number of package installs). -- Peter Dalgaard Center for Statistics, Copenhagen Business

Re: [R] Has anyone used Sweave with the Beamer poster macro for Latex ?

2010-08-20 Thread Peter Dalgaard
in the picture, beamer has trouble with verbatim environments. You usually need \begin{frame}[fragile] No guarantees, but worth a try. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Help Choosing Start Values for nls

2010-08-21 Thread Peter Dalgaard
read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] logistic regression tree

2010-08-22 Thread Peter Dalgaard
these days... grin -pd -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Package repository on Linux machine and upgrading R

2010-08-22 Thread Peter Dalgaard
to upgrades (but you may still need to update.packages()), but you obviously won't have the possibility of distinguishing between multiple versions of R, which can give both forwards and backwards compatibility problems. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone

Re: [R] Extract rows from a list object

2010-08-24 Thread peter dalgaard
lapply is.) For more intelligible and generalizable code, also consider do.call(rbind, lapply(huge.list, function(x)x[4,])) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] chisq.test on samples of different lengths

2010-08-24 Thread peter dalgaard
-guide.html and provide commented, minimal, self-contained, reproducible code. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Compiling Fortran for R : .so: mach-o, but wrong architecture

2010-08-24 Thread Peter Dalgaard
more info. Thank you for your time, Looks like you are trying to load a 64 bit module into a 32 bit R. Does it work better with R64? -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com

Re: [R] Sweave.sty

2010-08-24 Thread Peter Dalgaard
share/texmf -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Comparing samples with widely different uncertainties

2010-08-25 Thread peter dalgaard
roots and see if it makes the variances appear more stable and perhaps improve on the normality. Then maybe just do a paired t-test. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] GLM outputs in condensed versus expanded table

2010-08-25 Thread Peter Dalgaard
of depends on how far you came on the way to infinity. With the aggregated data, a perfect fit gives residuals of zero, but with individual data, the 0's and 1's give negative and positive residuals. Try z - rep(0:1,5) zz - cbind(5,5) summary(glm(z~1, binomial)) summary(glm(zz~1, binomial)) -- Peter

Re: [R] Problem with terms of the form (a 1) and subsetting of a terms object

2010-08-26 Thread peter dalgaard
just avoid going too near it. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https

Re: [R] Sorting groups in bwplot chart

2010-08-27 Thread peter dalgaard
), runif(100,1,10)); colnames(d) - c(Month, Value); bwplot(d$Month ~ d$Value); or ...factor(1:12. labels=month.abb)... -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda

Re: [R] make.rm

2010-08-27 Thread Peter Dalgaard
On 08/27/2010 08:38 PM, Bruce Johnson wrote: Where do I find this function? On Google, first hit... Now really, If you can't find it, how would you expect anyone else to, without any indication of what the function is supposed to do nor from where you got the idea to look for it? -- Peter

Re: [R] Calculating p and q values with R

2010-08-28 Thread Peter Dalgaard
be expected from the mailing lists. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] binomial distribution

2010-08-28 Thread Peter Dalgaard
) Check demo(plotmath), 4th-to-last example. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] glm prb (Error in `contrasts-`(`*tmp*`, value = contr.treatment) : )

2010-08-30 Thread peter dalgaard
at this point is: What does: with( tre, table(E,F) ) # show? Yes. Also notice the pattern of missing values. A likely scenario for the error would be to have E and F being something like gender and menarche, where the latter is absent for boys. -- Peter Dalgaard Center for Statistics

Re: [R] R code changes to crap

2010-09-02 Thread peter dalgaard
of luck. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Simultaneous equations

2010-09-02 Thread Peter Dalgaard
and 4 more symmetrically below zero. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] tcltk lost after update r-base 2.11.1-2hardy0 to 2.11.1-5hardy0

2010-09-06 Thread Peter Dalgaard
, people do need to know what the symptoms are, and what you did to upgrade? -- Peter Dalgaard Center for Statistics, Copenhagen Business School Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r-project.org mailing list https

Re: [R] How to project a vector on a subspace?

2010-09-08 Thread peter dalgaard
be bypassing some red tape, and otherwise do the same. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd@cbs.dk Priv: pda...@gmail.com __ R-help@r

  1   2   3   4   5   6   7   8   9   10   >