Displaying 5 results from an estimated 5 matches for "x2_2".
Did you mean:
x22
2007 Feb 27
1
interactions and GAM
...x1==2,"x2"]^4*(-3)+rnorm(11)+10000
data1[data1$x1==3,"y"]=10000*data1[data1$x1==3,"x2"]+rnorm(5)+10000
library(lattice)
xyplot(data1$y~data1$x2,groups=data1$x1)
#creation of dummy variables for interactions
data1$x2_1=ifelse(data1$x1=="1",data1$x2,NA)
data1$x2_2=ifelse(data1$x1=="2",data1$x2,NA)
data1$x2_3=ifelse(data1$x1=="3",data1$x2,NA)
#model fitting
library(gam)
model=gam(y~s(x2_1)+s(x2_2)+s(x2_3)+x1,data=data1,na=na.gam.replace)
#prediction fit well data :
summary(model)
plot(data1$x2,data1$y)
points(data1$x2,model$fitted.value,...
2008 Dec 11
1
Sorting problem
Sys.setlocale(,"C")
x1 <- as.character(date()) # I use date to record the time, and save
it to sqlite database, to it converted to character
x1_2 <- strptime(x1, "%a %b %d %H:%M:%S %Y")
x2 <- as.character(date())
x2_2 <- strptime(x2, "%a %b %d %H:%M:%S %Y")
X<-c(x1_2,x2_2)
order(X) ## I want to get the permutation other than the sorted vector.
## order(X) works in windows but not Linux.
any alternative way to the the permutation?
--
HUANG Ronggui, Wincent
Tel: (00852) 3442 3832
PhD Candidat...
2009 Sep 03
1
Help with GLM please!
...able which are not the ones I specified (I get labels I
even don't know where they are coming from)?
set.seed(12345)
dv <- gl(n=2, k=1, length=20, label=c("Yes", "No"))
x1 <- rnorm(n=20, mean=100, sd=10)
x2 <- gl(n=3, k=1, length=20, label=c("x2_1", "x2_2", "x2_3"))
mydata <- data.frame(dv,x1,x2)
mydata$f.x1 <- cut(x1, breaks=c(80,90,100,120))
mydata$f.x1 <- ordered(mydata$f.x1, labels=c("L1", "L2", "L3") ,
levels(mydata$f.x1)) #Specify desired labels
mydata$f.x1
attach(mydata)
mymodel <- glm...
2005 Sep 15
1
Coefficients from LM
Hi everyone,
Can anyone tell me if its possibility to extract the coefficients from the
lm() command?
For instance, imagine that we have the following data set (the number of
observations for each company is actually larger than the one showed...):
Company Y X1 X2
1 y_1 x1_1 x2_1
1 y_2 x1_2 x2_2
1 y_3 x1_3 x2_3
(...)
2 y_4 x1_4 x2_4
2 y_5 x1_5 x2_5
2 y_6 x1_6 x2_6
(...)
n y_n x1_n x2_n
n y_n1 x1_n1 x2_n1
n y_n2 x1_n2 x2_n2
(...)
I need to run a regression of Y=b0+b1*X1+b2*X2 for EACH company in the
dataset and then retrieve the coefficients for each regression obtained (and
t-stat...
2011 Dec 08
1
prop.test() and the simultaneous confidence interval for multiple proportions in R
Dear list members,
I want to perform in R the analysis "simultaneous confidence interval for multiple proportions", as illustrated in the article of Agresti et al. (2008) "Simultaneous confidence intervals for comparing binomial parameter", Biometrics 64, 1270-1275.
If I am not wrong the R function implementing the Agresti et al. method is prop.test(). I ask an help because I