[R] glm automation
Jean Eid
jeaneid at chass.utoronto.ca
Tue Mar 7 23:21:31 CET 2006
If you know what the dependent variable is called and is the same for
all regressions see
?formula
Or you can do glm(ABC~. , ...,data=dat)
PS. the way you are calling the formula you are taking the first element
in the first column and the first element in the second column. So that
is not what you want.
For plots
see ?postscript
Jean
A Mani wrote:
>Hello,
> I have two problems in automating multiple glm(s) operations.
>The data file is tab delimited file with headers and two columns. like
>
>"ABC" "EFG"
>1 2
>2 3
>3 4
>dat <- read.table("FILENAME", header=TRUE, sep="\t", na.strings="NA",
>dec=".", strip.white=TRUE)
>dataf <- read.table("FILENAME", header=FALSE, sep="\t", na.strings="NA",
>dec=".", strip.white=TRUE)
>norm1 <- glm(dataf[1,1] ~ dataf[1,2], family= normal(log), data=dat)
>norm2 <- glm(dataf[1,1] ~ dataf[1,2], family= normal(identity), data=dat)
>and so on.
>
>But glm does not work on the data unless I write ABC and EFG there... I want
>to automate the script for multiple files.
>
>The other problem is to write the plot(GLM) to a file without displaying it
>at stdout.
>
>Thanks,
>
>
>A. Mani
>Member, Cal. Math. Soc
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
More information about the R-help
mailing list