Displaying 2 results from an estimated 2 matches for "datfr".
Did you mean:
dater
2007 Jan 10
1
map data.frame() data after having linked them to a read.shape() object
...)],row.names=F))
str(temp)
'data.frame': 106 obs. of 50 variables:
$ stacount: Factor w/ 106 levels "ArizonaApache",..: 1 2 3 4 5 6 7 8 9
10 ...
$ 1950 : int 1 0 0 0 0 0 0 0 0 0 ...
[snip]
$ 2005 : int 0 0 0 0 0 0 0 0 0 0 ...
# Pick out a temporary attribute data.frame
datfr = a$att.data
# Merge the temporaty data frame with tabled "cases"
for(i in 2:ncol(temp)){
datfr = merge(datfr, temp[,c(1,i)], by.x="STACOUNT4",
by.y="stacount", all.x=T, all.y=F)
}
#Replace NAs with 0:
for(i in 61:109){
datfr[,i] = ifelse(is.na(datfr[,i])==...
2011 Apr 06
2
glm predict on new data
I am aware this has been asked before but I could not find a resolution.
I am doing a logit
lg <- glm(y[1:200] ~ x[1:200,1],family=binomial)
Then I want to predict a new set
pred <- predict(lg,x[201:250,1],type="response")
But I get varying error messages or warnings about the different number of
rows. I have tried data/newdata and also to wrap in data.frame() but cannot
get