[R] newly install old and present R versions

2012-02-03 Thread Thomas Mang
Hi, Moving to a new computer (Windows 7) but for reasons of reproduceability I would seriously like to also install my present R 2.8.1 along with all extension packages on that machine as well (that is besides R 2.14.1). What's the best way of doing so? My idea is: Get the setup for 2.8.1

Re: [R] Checking dates for entry errors

2012-01-17 Thread Thomas Mang
On 1/11/2012 11:07 PM, Paul Miller wrote: Hello Everyone, I have a question about how best to check dates for entry errors. Try using regular expression matching and the functions grep, strsplit, regexpr etc. If you are not familiar with regex: bit a bumpy road of getting into it but in the

[R] multinomial regression model

2011-05-10 Thread Thomas Mang
Hi, Consider the need for a regression model which can handle an ordered multinomial response variable. There are, for example, proportional odds / cumulative logit models, but actually the regression should include random effects (a mixed model), and I would not be aware of multinomial

Re: [R] random effects in mixed model not that 'random'

2009-12-13 Thread Thomas Mang
- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Thomas Mang Sent: Friday, December 11, 2009 6:19 PM To: r-h...@stat.math.ethz.ch Subject: [R] random effects in mixed model not that 'random' Hi, I have the following conceptual / interpretative question regarding

Re: [R] random effects in mixed model not that 'random'

2009-12-13 Thread Thomas Mang
? thanks Thomas What you have discovered is called selection bias. It is common in unrandomized studies. At 09:12 AM 12/13/2009, Thomas Mang wrote: HI, Thanks for your response; yes you are right it's not fully on topic, but I chose this list not only because I am using R for all my stats

[R] random effects in mixed model not that 'random'

2009-12-11 Thread Thomas Mang
Hi, I have the following conceptual / interpretative question regarding random effects: A mixed effects model was fit on biological data, with observations coming from different species. There is a clear overall effect of certain predictors (entering the model as fixed effect), but as

[R] MCMC sampling question

2009-08-12 Thread Thomas Mang
Hello, Consider MCMC sampling with metropolis / metropolis hastings proposals and a density function with a given valid parameter space. How are MCMC proposals performed if the parameter could be located at the very extreme of the parameter space, or even 'beyond that' ? Example to express

[R] ordinal response model with spatial autocorrelation

2009-08-10 Thread Thomas Mang
Hi, [note: 4th posting trial - apologize if the other ones would ever show up...] I have a (3-level) ordinal response data set which needs the integration of an spatial autocorrelation structure. What packages / functions are available to fit such a thing ? The heterogeneous,

Re: [R] min frequencies of categorical predictor variables in GLM

2009-08-04 Thread Thomas Mang
Marc Schwartz wrote: On Aug 3, 2009, at 12:06 AM, Thomas Mang wrote: Hi, Suppose a binomial GLM with both continuous as well as categorical predictors (sometimes referred to as GLM-ANCOVA, if I remember correctly). For the categorical predictors = indicator variables

[R] min frequencies of categorical predictor variables in GLM

2009-08-02 Thread Thomas Mang
Hi, Suppose a binomial GLM with both continuous as well as categorical predictors (sometimes referred to as GLM-ANCOVA, if I remember correctly). For the categorical predictors = indicator variables, is then there a suggested minimum frequency of each level ? Would such a rule/

[R] convert factor to indicator matrix

2009-07-01 Thread Thomas Mang
Hi, I am looking for a function which can convert a single factor (a vector), or a list of multiple factors, into the indicator (dummy) matrix with 0/1 entries (or other contrasting schemes). I could cook it myself, but I am actually sure this thing already exists - but forgot the name and

[R] 'singularity' between fixed effect and random factor in mixed model

2009-07-01 Thread Thomas Mang
Hi, I just came across the following issue regarding mixed effects models: In a longitudinal study individuals (variable ind) are observed for some response variable. One explanatory variable, f, entering the model as fixed effect, is a (2-level) factor. The expression of that factor is

[R] MCMC validity question

2009-06-10 Thread Thomas Mang
Hello, I have quite a tough problem, which might be able to be solved by MCMC. I am fairly new to MCMC (in the learning process) - so apologize if the answer is totally obvious, and any hints, links etc are greatly appreciated. I'll illustrate the problem in a version cut-down to the

Re: [R] converting numeric to integer

2009-05-17 Thread Thomas Mang
as left-hand argument for the sum operation. Is there however still a more 'elegant' way ? thanks, Thomas Gabor Grothendieck wrote: Try: as.integer(x + 0.5) assuming the calculation error is less than 0.5 . On Sat, May 16, 2009 at 2:49 PM, Thomas Mang thomas.m...@fiwi.at wrote: Hello, Suppose

[R] converting numeric to integer

2009-05-16 Thread Thomas Mang
Hello, Suppose I have x, which is a variable of class numeric. The calculations performed to yield x imply that mathematically it should be an integer , but due to round-off errors, it might not be (and so in either direction). The error is however small, so round(x) will yield the

[R] changing function argument

2009-03-13 Thread Thomas Mang
Hi, I wonder if the following is possible in R: Suppose a function takes an argument, and wants to modify this argument so that the change is visible _at the call side_. It would be what is for example known as pass-by-reference-to-non-const in C++. test - function(x) { x - 10 ... return

Re: [R] changing function argument

2009-03-13 Thread Thomas Mang
Dieter Menne wrote: Thomas Mang thomas.mang at fiwi.at writes: I wonder if the following is possible in R: Suppose a function takes an argument, and wants to modify this argument so that the change is visible _at the call side_. It would be what is for example known as pass-by-reference

Re: [R] difference between assignment syntax - vs =

2009-02-23 Thread Thomas Mang
Inferno' page 78 is one source you can look at. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Thomas Mang wrote: Hi, Both operators - and = can be used to make an assignment. My question

[R] difference between assignment syntax - vs =

2009-02-21 Thread Thomas Mang
Hi, Both operators - and = can be used to make an assignment. My question is: Is there a semantic difference between these two? Some time ago, I remember I have read that because of some reason, one should be given preference over the other - but I cannot remember the source, nor the

[R] which test-statistic to use for quasibinomial GLMs?

2009-02-18 Thread Thomas Mang
Hi, I have fitted quasibinomial GLM [glm(y ~ ..., family = quasibinomial)] to a binary response variable; quasibinomial, because there were clear signs of underdispersion in a 'simple' binomial GLM, and so the dispersion is a free parameter in the model. My question is now: In a

[R] generalized mixed model + mcmcsamp

2009-02-11 Thread Thomas Mang
Hi, I have fitted a generalized linear mixed effects model using lmer (library lme4), and the family = quasibinomial. I have tried to obtain a MCMC sample, but on calling mcmcsamp(model1, 1000) I get the following error which I don't understand at all: Error in .local(object, n, verbose,

[R] bootstrapping in regression

2009-01-29 Thread Thomas Mang
Hi, Please apologize if my questions sounds somewhat 'stupid' to the trained and experienced statisticians of you. Also I am not sure if I used all terms correctly, if not then corrections are welcome. I have asked myself the following question regarding bootstrapping in regression: Say for

Re: [R] bootstrapping in regression

2009-01-29 Thread Thomas Mang
Greg Snow wrote: What you are describing is actually a permutation test rather than a bootstrap (related concepts but with a subtle but important difference). The way to do a permutation test with multiple x's is to fit the reduced model (use all x's other than x1 if you want to test x1) on

[R] .C and 'temporaries'

2008-12-23 Thread Thomas Mang
Hello, Before I get into troubles I ask here: I make a call to a C function using .C. What I would like to know is if the arguments in the .C call can also be 'temporary' objects. An example will illustrate this: # here we don't have a temporary Obj1 = 5 .C(Func, as.integer(Obj1 ), ...) #

[R] timezone attribute lost during operations

2008-11-21 Thread Thomas Mang
Hi, I was just *highly* surprised to find out that R 2.8.0 (Windows XP) changes the timezone-interpretation during operations on time data, as apparently the timezone attribute is lost and then, for the next interpretation of the timezone, the system settings are used. Here is sample code