Skip to content
Prev 138614 / 398503 Next

ipf function in R

On Wed, 5 Mar 2008, Chandra Shah wrote:

            
I'd use loglin()

 	newtab <-
 		loglin(	rowmarg%o%colmarg/sum(colmarg),
 		margin=list(1,2),
 		start=tab, fit=TRUE )$fit


with rowmarg and colmarg set to your updated marginals.

As for inputting the data, if this is all you have, type it in at the 
command line. See

 	?matrix
 	?c

and note this:
HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901