Re: [R] Meta-analysis with zero values for mean and sd

2011-07-11 Thread Viechtbauer Wolfgang (STAT)
I know nothing about the biological background here, but I also wonder if the standard meta-analytic approach is meaningful here. I also see some confusion in terminology (these are not count data!). There appear to be only 3 observations per group in each of the studies -- the standard

Re: [R] Metafor: Differences between two categories of a moderator

2011-06-02 Thread Viechtbauer Wolfgang (STAT)
Well, that's a good question. It actually applies to many different contexts (not just meta-analysis). Think of the ANOVA F-test and post-hoc/planned contrasts. It's essentially the same situation. And if you would ask 10 different statisticians about this, you may get 11 different answers. My

Re: [R] Metafor: Differences between two categories of a moderator

2011-05-31 Thread Viechtbauer Wolfgang (STAT)
Dear Holger, Actually, the omnibus test (QM-test) will give you the same result regardless of which category you make the reference category (try it out!). So, it will pick up all of the differences, whether they are to the reference category or between any of the other categories. If the

Re: [R] simulations with very large number of iterations (1 billion)

2011-04-15 Thread Viechtbauer Wolfgang (STAT)
We do not know the details of the kinds of computations you intend to do within each iteration, but if, let's say, each iterations takes around 1 second, then your simulation will run for the next 30+ years (on a single core). Even if each iteration only takes a fraction of a second, you are

Re: [R] forest + igraph ?

2011-04-13 Thread Viechtbauer Wolfgang (STAT)
616 6200 MD Maastricht, The Netherlands Tel: +31 (43) 368-5248 Fax: +31 (43) 368-8689 Web: http://www.wvbauer.com -Original Message- From: Samor Gandhi [mailto:samorgan...@yahoo.com] Sent: Tuesday, April 12, 2011 15:59 To: r-h...@stat.math.ethz.ch; Viechtbauer Wolfgang (STAT

Re: [R] forest + igraph ?

2011-04-12 Thread Viechtbauer Wolfgang (STAT)
It is not clear (at least to me) what exactly you want. You want two forest plots in one graph but apparently not side-by-side or one on top and the other on the bottom. So, you want to superimpose them? How do you want to do that without creating an illegible mess? Or do you want one graph,

Re: [R] forest + igraph ?

2011-04-12 Thread Viechtbauer Wolfgang (STAT)
...@stat.math.ethz.ch; Viechtbauer Wolfgang (STAT) Subject: RE: [R] forest + igraph ? Thank you for your reply. I would like to have two forest plots one on top and the other on the bottom. I am using R version 2.12.2 (32-bit) Windows. The code you sent me still plotting two windows one after the other

Re: [R] metaplot

2011-04-08 Thread Viechtbauer Wolfgang (STAT)
To: Viechtbauer Wolfgang (STAT) Cc: R-help@r-project.org Subject: Re: [R] metaplot Thank you for your reply. forest(log(rr), ci.lbhttp://ci.lb=lci, ci.ub=uci, xlab=Log Relative Risk) Error in sei^2 : 'sei' is missing Regards, Cheba 2011/4/7 Viechtbauer Wolfgang (STAT) wolfgang.viechtba

Re: [R] metaplot

2011-04-07 Thread Viechtbauer Wolfgang (STAT)
Actually, Scott suggested ggplot2, which is available on CRAN: http://cran.r-project.org/web/packages/ggplot2/index.html Moreover, for the metafor package, you do not need (a,b,c,d) or standard errors for the effect estimates. rr - c(0.61, 0.35, 1.16, 0.94, 1.16, 0.46, 0.99, 1.05, 1.15, 0.27)

Re: [R] System of related regression equations

2011-02-22 Thread Viechtbauer Wolfgang (STAT)
What you are describing is a path model (e.g., http://bit.ly/f4siTs). You can fit such a model with the sem package (http://cran.r-project.org/web/packages/sem/index.html). Best, -- Wolfgang Viechtbauer Department of Psychiatry and Neuropsychology School for Mental Health and Neuroscience

Re: [R] Help Metafor

2011-02-21 Thread Viechtbauer Wolfgang (STAT)
Dear Mario, If you could tell me how to define and interpret I^2 and H^2 for models with moderators, I may consider implementing these measures for such models. However, I am not aware of any work that has extended these measures to meta-regression models. Best, -- Wolfgang Viechtbauer

Re: [R] txtProgressBar examples?

2011-02-15 Thread Viechtbauer Wolfgang (STAT)
Dear Mario, See: http://www.mail-archive.com/r-help@r-project.org/msg117622.html This seems to be fixed in version 2.12.1 (at least, I do not get this problem anymore). Best, Wolfgang From: r-help-boun...@r-project.org [r-help-boun...@r-project.org]

Re: [R] Optimal Y=q cutoff after logistic regression

2011-02-14 Thread Viechtbauer Wolfgang (STAT)
That's definitely one for the fortune package! Wolfgang -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Frank Harrell Sent: Monday, February 14, 2011 14:50 To: r-help@r-project.org Subject: Re: [R] Optimal Y=q cutoff after

Re: [R] Random Effects Meta Regression

2011-01-16 Thread Viechtbauer Wolfgang (STAT)
If b is the coefficient from the meta-regression model that indicates the (average) change in the outcome measure for a one-unit increase in the corresponding explanatory variable, then 5*b is the (average) change in the outcome measure for a 5-unit increase in the explanatory variable. Or

Re: [R] Metafor vs Meta vs Spreadsheet: wrong numbers

2011-01-13 Thread Viechtbauer Wolfgang (STAT)
Dear Serge-Étienne, Try: res - rma.uni(yi, vi, data=dat, method=DL) for the random-effects model when using the metafor package. You used method=HE -- this will give you a different estimator of tau^2 then the one used in the meta package. Best, -- Wolfgang Viechtbauer Department of

Re: [R] metafor/ meta-regression

2011-01-13 Thread Viechtbauer Wolfgang (STAT)
Dear Fernanda, Currently, there is no option in metafor that will automatically give you standardized coefficients for meta-regression models. The question is also how you would like to standardize those coefficients. In the usual regression models, the standardized coefficients are those that

Re: [R] sample() issue

2010-12-20 Thread Viechtbauer Wolfgang (STAT)
See FAQ 7.31: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f And try this: 25000*(1-.55) - 11250 25000*.45 - 11250 Notice a difference? Best, -- Wolfgang Viechtbauer Department of Psychiatry and Neuropsychology School for Mental Health and

Re: [R] sample() issue

2010-12-20 Thread Viechtbauer Wolfgang (STAT)
Trying to make the fastest referal to FAQ 7.31 is becoming quite a sport around here. David beat us all to it on this round. Chances are there will be many more rounds to come. Best, Wolfgang Original Message From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On

Re: [R] Metafor package

2010-12-20 Thread Viechtbauer Wolfgang (STAT)
Dear Mario, 1) Whether to use 1/2* or not is arbitary. It's just a multiplicative constant. 2) vi - 1/(4*ni + 2) If one leave off the 1/2* part, then it would be vi - 1/(ni + 1/2). 3) Yes, but it takes a bit more work. Fortunately, the same issue was raised not very long ago, so the following

Re: [R] Using Metafor package: how to backtransform model coefficients when Freeman Tukey double arcine transformation is used

2010-12-16 Thread Viechtbauer Wolfgang (STAT)
Dear Patricia, I was recently asked the exact same question, so the answer is yes, but it takes a little bit of extra work and the newest version of the metafor package (version 1.5-0, which was submitted to CRAN yesterday and which should hopefully be ready for download in a few days). I'll

Re: [R] txtProgressBar strange behavior in R 2.12.0

2010-11-22 Thread Viechtbauer Wolfgang (STAT)
I believe nobody has responded to far, so maybe this is not a wide-spread issue. However, I have also encountered this since upgrading to R 2.12.0 (Windows 7, 64-bit). In my simulations where I use txtProgressBar(), the problem usually disappears after the bar has progressed to a certain

Re: [R] Breslow-Day test

2010-11-16 Thread Viechtbauer Wolfgang (STAT)
It's implemented in the metafor package. Using the example from the pdf that Marc pointed out: library(metafor) ai - c(53, 121, 95, 103, 64, 7, 0) bi - c(2, 3, 14, 27, 51, 29, 13) ci - c(61, 152, 114, 66, 81, 28, 0) di - c(1, 5, 7, 12,

Re: [R] metafor: including phylogenetic non-independence among species?

2010-11-12 Thread Viechtbauer Wolfgang (STAT)
Dear Scott, The short answer is: No, this is not possible. The longer answer is: In principle, this will be possible in the future. I am working on functions for the metafor package for multivariate meta-analyses (i.e., where we no longer assume that the observed outcomes or effect size

Re: [R] Key combination that removes all R objects

2010-10-28 Thread Viechtbauer Wolfgang (STAT)
I am not aware of the existance of a shortcut that would do what you describe. On Windows, one could hit Ctrl-M, followed by R, but then one gets a prompt, asking for confirmation to remove all objects, but this can't be what you are referring to. Are you perhaps using Tinn-R and

Re: [R] Setting constraints in the glm package

2010-10-26 Thread Viechtbauer Wolfgang (STAT)
The constraint b1=b2 in a model such as b0 + b1 x1 + b2 x2 + b3 x3 implies that b0 + b1 (x1 + x2) + b3 x3, so just add x1 and x2 (call this x12) and fit the model b0 + b1 x12 + b3 x3 and you have imposed the constraint that b1=b2. To impose the constraint that b3=0, just fit the model without

Re: [R] Poisson Regression

2010-10-14 Thread Viechtbauer Wolfgang (STAT)
I think it's useful to realize that this approach still implies that the \phi_{i}'s are entered as fixed effects into the model (as opposed to treating the \phi_{i}'s as random effects); it's just that the iterative algorithm to obtain the maximum likelihood estimates is faster when using

Re: [R] Highly significant intercept and large standard error

2010-10-06 Thread Viechtbauer Wolfgang (STAT)
I do not know about the details of the model, but the results are not all that strange. I'll assume that you are using family=gaussian(), so you are essentially running a model where (Intercept) reflects the mean of the dependent variable for that third category (MagMid) of the Mag factor and

Re: [R] Highly significant intercept and large standard error

2010-10-06 Thread Viechtbauer Wolfgang (STAT)
Debyeplein 1 (Randwyck) Original Message From: Chris Mcowen [mailto:sam_sm...@me.com] Sent: Wednesday, October 06, 2010 16:38 To: Viechtbauer Wolfgang (STAT) Cc: r-help@r-project.org Subject: Re: [R] Highly significant intercept and large standard error Hi Wolfgang, Thanks

Re: [R] Fixed variance structure for lme

2010-10-05 Thread Viechtbauer Wolfgang (STAT)
If the sampling variances are known up to a proportionality constant, then you can use: weights = varFixed(~ vi) where vi is the vector of the 50 sampling variances (corresponding to the 50 values of the dependent variable). You may have to create the vi vector by repeating the 5 sampling

Re: [R] metafor and meta-analysis at arm-level

2010-08-09 Thread Viechtbauer Wolfgang (STAT)
Room B2.01 (second floor) 6200 MD Maastricht, The Netherlands Debyeplein 1 (Randwyck) Original Message From: Angelo Franchini [mailto:angelo.franch...@bristol.ac.uk] Sent: Sunday, August 08, 2010 13:09 To: Viechtbauer Wolfgang (STAT) Cc: r-help@r-project.org Subject: RE: [R

Re: [R] metafor and meta-analysis at arm-level

2010-08-05 Thread Viechtbauer Wolfgang (STAT)
: Maastricht University, P.O. Box 616 Room B2.01 (second floor) 6200 MD Maastricht, The Netherlands Debyeplein 1 (Randwyck) Original Message From: Angelo Franchini [mailto:angelo.franch...@bristol.ac.uk] Sent: Wednesday, August 04, 2010 16:26 To: Viechtbauer Wolfgang (STAT) Cc

Re: [R] Metafor

2010-08-05 Thread Viechtbauer Wolfgang (STAT)
Correct. -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31 (0)43 388-2277 School for Public Health and Primary Care Office Location: Maastricht University, P.O. Box 616 Room B2.01 (second floor) 6200 MD

Re: [R] metafor and meta-analysis at arm-level

2010-07-09 Thread Viechtbauer Wolfgang (STAT)
With appropriate design matrix, I mean the X matrix in the mixed-effects model y = Xb + u + e, where y is the vector of outcomes, u is a vector of (possibly correlated) random effects, and e is a vector of (possibly) random errors. The X matrix is specified via the 'mods' argument in the rma()

Re: [R] Question on WLS (gls vs lm)

2010-06-24 Thread Viechtbauer Wolfgang (STAT)
The weights in 'aa' are the inverse standard deviations. But you want to use the inverse variances as the weights: aa - (attributes(summary(f1)$modelStruct$varStruct)$weights)^2 And then the results are essentially identical. Best, -- Wolfgang Viechtbauer

Re: [R] meta analysis with repeated measure-designs?

2010-06-12 Thread Viechtbauer Wolfgang (STAT)
Dear Gerrit, the most appropriate approach for data of this type would be a proper multivariate meta-analytic model (along the lines of Kalaian Raudenbush, 1996). Since you do not know the correlations of the reaction time measurements across conditions for the within-subject designs, a

Re: [R] back transforming arcsine transformations in metafor

2010-06-10 Thread Viechtbauer Wolfgang (STAT)
Dear Chris, Just define the following function: transf.iasin - function(x) { z - sin(x)^2 return(z) } to give the inverse of the arcsine transformation. Then specify this function under the atransf argument. I will add the transf.iasin() function to the package. Best, -- Wolfgang

Re: [R] R crashing oddly

2010-04-22 Thread Viechtbauer Wolfgang (STAT)
A similar problem was mentioned before: https://stat.ethz.ch/pipermail/r-sig-mixed-models/2008q3/001425.html There appears to be a bug in the C code leading to memory corruption. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and

[R] Writing methods for existing generic function

2010-04-19 Thread Viechtbauer Wolfgang (STAT)
Dear All, Suppose I want to write a method for the generic function confint(): args(confint) function (object, parm, level = 0.95, ...) So, it looks like the second and third argument have been predefined in the generic function. Suppose one or several of the predefined arguments don't apply

Re: [R] creating a new corClass for lme()

2010-04-14 Thread Viechtbauer Wolfgang (STAT)
No idea if this helps, but if the optimizer (nlminb) is giving you problems, you could try switching to another optimizer (nlm) with: control=list(opt=nlm) Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31 (43)

Re: [R] add a header to a forest plot (metafor)

2010-03-02 Thread Viechtbauer Wolfgang (STAT)
Hi Sebastian, Here is an example showing a forest plot with some column headings: library(metafor) data(dat.bcg) dat - dat.bcg res - rma(ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, measure=RR) windows(width=6.5,

Re: [R] tests for measures of influence in regression

2010-02-22 Thread Viechtbauer Wolfgang (STAT)
I don't think this information can be found in the documentation, but you can always just check the actual influence.measures() and print.infl() code to find out. Most importantly, influence.measures() incldues the following code: function (model) { is.influential - function(infmat, n) {

Re: [R] metafor package: effect sizes are not fully independent

2010-02-08 Thread Viechtbauer Wolfgang (STAT)
Hello Gang, Mike has already given you some excellent advice and references. I just want to add some information about the metafor package. To be precise, the meta-analytic mixed-effects model is given by: y_i = X_i * beta_i + u_i + e_i where X_i and beta_i have the usual interpretation, u_i

Re: [R] add points to 3D plot using p3d {onion}

2010-01-27 Thread Viechtbauer Wolfgang (STAT)
Just as an aside, the scatterplot3d package does things like this very cleverly. Essentially, when you create a plot with scatterplot3d, the function actually returns functions with values set so that points3d(), for example, knows the axis scaling. Best, -- Wolfgang Viechtbauer

Re: [R] Once again: Error: cannot allocate vector of size

2010-01-22 Thread Viechtbauer Wolfgang (STAT)
The problem I see here is not so much the 27136 observations, but the fact that the first two factors have up to 101 different levels and the third factor up to 1001 different levels. That means that lm() is essentially creating 100+100+1000 dummies for those factors, leading to a large (and

[R] Is the Intercept Term always in First Position?

2010-01-05 Thread Viechtbauer Wolfgang (STAT)
Dear All, I have a question about formulas and model.matrix(). If one specifies a model via a formula, the corresponding design matrix can be obtained with the model.matrix() function. For example: x1 - c(1,4,2,3,5) x2 - c(1,1,2,2,2) myformula - ~ x1 + factor(x2) model.matrix(myformula) My

Re: [R] metafor: using mixed models

2010-01-04 Thread Viechtbauer Wolfgang (STAT)
Dear Joris, When you call rma() with the (default) argument intercept=TRUE, then the intercept is added to the X matrix (a column of 1s is added). So, if you use: fac - c(1,1,2,3,3,4,4,5,5,5) X - model.matrix(~factor(fac))[,2:5] and then: rma(ai, bi, ci, di, mods=X, data=testdata, measure=OR)

Re: [R] help: forest plots

2009-12-14 Thread Viechtbauer Wolfgang (STAT)
If you have the bounds of a 95% CI in the form of: exponential(estimate +/- 1.96*SE) then it is easy to get the SE back: SE = (log(UL) - log(LL)) / (2*1.96) Then supply the estimates and the SEs to the forest() function: forest(estimate, sei=SE) You can use: forest(estimate, sei=SE,

Re: [R] Forest Plot

2009-12-07 Thread Viechtbauer Wolfgang (STAT)
Debyeplein 1 (Randwyck) Original Message From: Xin Ge [mailto:xingemaill...@gmail.com] Sent: Sunday, December 06, 2009 00:40 To: Viechtbauer Wolfgang (STAT) Cc: r-help@r-project.org Subject: Re: [R] Forest Plot Thanks for your reply. Which function I should explore in metafor package

Re: [R] Forest Plot

2009-12-05 Thread Viechtbauer Wolfgang (STAT)
The figure that you linked to was produced with the metafor package. It can also be used to produce a forest plot if you have means and corresponding standard errors of the means. The standard error of a mean is equal to SD / sqrt(n), so as long as you also know the sample sizes (n), you can

Re: [R] z to r transformation within print.rma.uni and forest from the package metafor

2009-12-04 Thread Viechtbauer Wolfgang (STAT)
Dear Sebastian, Glad to hear you find the package useful. Before I get to your questions, just as an aside - you can leave default arguments out of the call. So: MAergebnis-rma.uni(ri=PosOutc, ni=N, data=dm, slab=c(dm$Article, dm$StudyNo), measure=ZCOR, method=DL) would do exactly the same as

Re: [R] Structural Equation Models(SEM)

2009-11-25 Thread Viechtbauer Wolfgang (STAT)
The model you have specified there is not an ordinary factor analysis model. This may be closer to what you are thinking of: model.RLIM - specify.model() f1 - R, laddR, NA f1 - L, laddL, NA f1 - I, laddI, NA f1 - M, laddM, NA R - R, dR, NA L - L, dL, NA

Re: [R] multivariate meta-analysis with the metafor package

2009-11-15 Thread Viechtbauer Wolfgang (STAT)
Dear Antonio, Yes, I am currently working on these extensions. It will take some time before those functions are sufficiently tested and documented and can become part of the metafor package. My goal is to do so within the next year, but I cannot give any specific date for when this will be

Re: [R] Finding covariance in a lmer mixed effects model

2009-11-11 Thread Viechtbauer Wolfgang (STAT)
The way you have specified the model implies that the covariance is 0. If you actually want to estimate the covariance, you need to use: fm1 - lmer(fpg ~ 1 + time + (time|ID), fpg_lme) Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and

Re: [R] influence.measures(stats): hatvalues(model, ...)

2009-11-08 Thread Viechtbauer Wolfgang (STAT)
Not sure what you mean. yi - c(2,3,2,4,3,6) xi - c(1,4,3,2,4,5) res - lm(yi ~ xi) hatvalues(res) X - cbind(1, xi) diag( X%*%solve(t(X)%*%X)%*%t(X) ) Same result. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31

Re: [R] MCMC gradually slows down

2009-11-08 Thread Viechtbauer Wolfgang (STAT)
Try this: Instead of: theta = c() use: theta - rep(NA, 50) or however many iterations you want the algorithm to run. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31 (0)43 388-2277 School for Public Health

Re: [R] how to fetch rows with certain characteristics

2009-10-29 Thread Viechtbauer Wolfgang (STAT)
tapply(x, y, min) where x is the vector of numbers and y the vector of class labels. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/ Department of Methodology and StatisticsTel: +31 (0)43 388-2277 School for Public Health and Primary Care Office Location:

Re: [R] structural equation modeling

2009-10-28 Thread Viechtbauer Wolfgang (STAT)
There is the 'sem' package: http://cran.r-project.org/web/packages/sem/index.html The task views (http://cran.r-project.org/web/views/) are often a good place to start when looking for particular techniques/methods. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/

Re: [R] Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1

2009-09-07 Thread Viechtbauer Wolfgang (STAT)
Are the two models (f1 and f2) actually nested? Aside from that, it is strange that the output is exactly the same after you used REML=FALSE. The log likelihoods should have changed. Best, -- Wolfgang Viechtbauer Department of Methodology and Statistics School for Public Health and Primary

Re: [R] metafor random effects meta-analysis

2009-08-13 Thread Viechtbauer Wolfgang (STAT)
Correct, it is not possible to fix the residual variance to 1 in the R version of lme(), which is what one (typically) wants to do in meta-analyses, where the sampling variances are assumed to be (approximately) known. This is however possible in S-Plus, if you have access to that. Adding:

Re: [R] Summarising Data for Forrest Plots

2009-07-29 Thread Viechtbauer Wolfgang (STAT)
Are n.FD and n.RD the number of people who received the full/reduced dose and surv.FD and surv.RD the number of people that survived? And are the people who received the full dose different from the people who received the reduced dose? And what exactly is it that you want to plot in the forest

[R] New Meta-Analysis Package (metafor)

2009-06-05 Thread Viechtbauer Wolfgang (STAT)
A new package is now available via CRAN, called metafor. The metafor package consists of a collection of functions for conducting meta-analyses in R. Fixed- and random-effects models (with and without moderators) can be fitted via the general linear (mixed-effects) model. For 2x2 table data,

Re: [R] meta regression in R using lme function

2009-04-30 Thread Viechtbauer Wolfgang (STAT)
Hello Jan, As far as know, fixing sigma to 1 is not possible in R with lme. That is why I started to write my own functions to allow me to fit mixed-effects models in R. Quite some time ago, I put one of those functions on my website, which can be downloaded here:

Re: [R] p-values from bootstrap - what am I not understanding?

2009-04-15 Thread Viechtbauer Wolfgang (STAT)
Some useful comments have already been made. I would like to comment on the two definitions of the p-value under (4) -- since I thought exactly about this issue a while back. Maybe this will be useful ... Suppose the distribution of a test statistic Z under H0 is given by f(Z) and that the

Re: [R] LME as part of meta-analysis

2009-03-28 Thread Viechtbauer Wolfgang (STAT)
Don't worry Emmanuel, not even people in Germany can figure out how exactly my last name is spelled =) I am actually getting quite close to finishing and releasing a first version of the package. The mima function will become obsolete at that point. Regarding the original post -- I am not

[R] R on an Asus Eee PC (step-by-step guide)

2008-04-28 Thread Viechtbauer Wolfgang (STAT)
Dear All, A while back, the question was raised whether R would run on an Eee PC: http://tolstoy.newcastle.edu.au/R/e3/help/07/12/6564.html There were some positive responses and some suggestions for getting this to work: http://tolstoy.newcastle.edu.au/R/e3/help/07/12/7244.html For those

[R] Optional data argument for a function

2008-02-29 Thread Viechtbauer Wolfgang (STAT)
Dear All, I am working on a function that has an optional data argument, just like lm(). If the user sets the data argument equal to some dataframe, then the function should look inside the dataframe for the variables given to other arguments, otherwise the variables should be accessible from

Re: [R] OLS standard errors

2008-02-26 Thread Viechtbauer Wolfgang (STAT)
Try multiplying var(e) by n-1 and dividing by n-3 (97 are the degrees of freedom for the sum of squares error in your example). Then it all matches up nicely. Best, -- Wolfgang Viechtbauer  Department of Methodology and Statistics  University of Maastricht, The Netherlands  

<    1   2