[R] (Meta-analysis) How to build|fake a [n]lm[e] object ?

friendly@hotspur.psych.yorku.ca friendly at hotspur.psych.yorku.ca
Wed Dec 5 18:38:20 CET 2001


Emmanuel-

Perhaps I can help with one thing:

! However, I do *not* have the raw data. Of course, I can trivially rebuild  
the
! "sum-of-data" and "sum-of-squares" in each "cell" of the potential
! "experimental plan". But I'm not able to analyse this. I looked in old  
books
! (some dating back from the '50s, wher computers were not readily available  
for
! biostatistics) and saw that all algorithms used back then supposed a  
*balanced*

There is a simple solution to the problem of going from summary statistics
to an lm() analysis which gives equivalent results, described by Larsen,
and implemented by me as a SAS macro, stat2dat.  The freq= variable
would become the weight= in lm().

/*= 

 name: STAT2DAT
title: Transform a summary data set to pseudo-observations
  Doc: http://www.math.yorku.ca/SCS/sasmac/stat2dat.html
Version: 1.1
Revised: 2 Apr 1999 


=Description:

Take a dataset containing summary statistics (N, mean, std dev) for
a between groups design and produce a dataset from which PROC GLM
can be run to produce equivalent results.

=Usage:
   %stat2dat(data=inputdataset, out=outputdataset, ..., 

      depvar=Y, freq=freq)

      The input dataset contains one observation for each group.
      Supply the names of variables containing the N, MEAN, and standard
      deviation (STD) for each group (see argument list below);  The
      mean square error (MSE) for a reported ANOVA can be supplied instead
      of individual STD values.  The sample size per cell can be supplied
      as a constant rather than a dataset variable if all groups are of the
      same size.  


      The output dataset can then be used with PROC GLM or PROC ANOVA
      (balanced designs).  It contains all variables from the input dataset
      plus a constructed dependent variable ('Y' by default) and
      a constructed frequency variable ('freq' by default).
      

   proc glm data=outputdataset;
      class classvars;
      freq freq;
      model Y = modelterms;
      

Based on:  David Larsen, Analysis of Variance With Just Summary Statistics
   as Input,  The American Statistician, May 1992, Vol. 46(2), 151-152.
   (David Larson:   dalef at uno.edu)


Michael Friendly	<friendly at yorku.ca>
Psychology Department, York University
Toronto, ONT  M3J 1P3 CANADA
=*/

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list