Displaying 2 results from an estimated 2 matches for "x999".
Did you mean:
1999
2005 Jun 29
2
quick way to construct formula
Dear R users,
I have a data with 1000 variables named "x1", "x2", ..., "x1000", and
I want to construct a formula like this format:
~x1+x2+...+x1000+x1:x2+x1:x3+x999:x1000+log(x1)+...+log(x1000)
That is: the base variables followed by all interaction terms and all
base feature log-transformations. I know I can use several paste
functions to construct it. But is there any other handy way to do it?
-Luke
2011 Feb 25
1
help please ..simple question regarding output the p-value inside a function and lm
...rame (dataf1, ind,y)
names(dataf) <- (c(paste("x",1:1000, sep=""),"ind", "y"))
for(i in 1:1000) {
dataf[,i] <- rnorm(100)
}
# my intension was to fit a model that would fit the following fashion:
y ~ x1 +x2, y ~ x3+x4, y ~ x5+ x6............y ~ x999+x1000 (to end of the
dataframe)
# please not that I want to avoid to fit y ~ x2 + x3 or y ~ x4 + x5 (means
that I am selecting two x variables at time to end)
# question: how can I do this and put inside a user function as I worked out
the following???
# defining function for lm mode...