Displaying 20 results from an estimated 43 matches for "dd2".
Did you mean:
d2
2008 Nov 13
0
sem and "simple variables"
...tudinal modeling with sem and thought calculating some
"simple variables" would make my model more readable. this is the smallest
subset of my model that illustrates the resulting problem.
i have 2 observed exogenous variables (c1, d2) and 4 observed endogenous
variables (dc1, dd1, dc2, dd2). c1 is the observed state at time 1, dc1 is
the change in c from time 1 to time 2 and dc2 is the change in c from time 2
to time 3. i want to predict dc1 and dd1 from both c1 and d1.
similarly i want to predict dc2 and dd2 from c2 and d2. to do this i
calculate c2 as a "simple variable&qu...
2007 Mar 27
3
Unexpected result of as.character() and unlist() applied to a data frame
Hi,
> dd <- data.frame(A=c("b","c","a"), B=3:1)
> dd
A B
1 b 3
2 c 2
3 a 1
> unlist(dd)
A1 A2 A3 B1 B2 B3
2 3 1 3 2 1
Someone else might get something different. It all depends on the
values of its 'stringsAsFactors' option:
> dd2 <- data.frame(A=c("b","c","a"), B=3:1, stringsAsFactors=FALSE)
> dd2
A B
1 b 3
2 c 2
3 a 1
> unlist(dd2)
A1 A2 A3 B1 B2 B3
"b" "c" "a" "3" "2" "1"
Same thing with as.character:
> as.chara...
2006 Aug 24
1
Using a 'for' loop : there should be a better way in R
...op
mp <- c(1, 5, 10) # inflation factor
tt <- data.frame(matrix(NA, length(nn), 2))
names(tt) <- c("s1","s2")
rownames(tt) <- nn
for (i in 1:length(nn)){
scat <- data.frame(matrix(NA, length(hh),2))
dd1 <- subset(df1, id==nn[i])
for (j in 1:length(hh)){
dd2 <- subset(dd1, dd1$years==hh[j])
s1 <- sum(dd2$cat1,dd2$cat2, na.rm=T)
s2 <- sum(dd2$cat3,dd2$cat4,na.rm=T)
scat[j,] <- c(s1,s2) *mp[j] # multiply by the
inflation factor
}
crush <- apply(scat, 2, sum)
tt[i,] <- crush
}
tt
2003 Dec 04
4
bug in as.POSIXct ?
I think that there is a bug in the as.POSIXct function on Windows.
Here is what I get on Win2000, Pentium III machine in R 1.8.1.
> dd1 <- ISOdatetime(2003, 10, 26, 0, 59, 59)
> dd2 <- ISOdatetime(2003, 10, 26, 1, 0, 0)
> dd2 - dd1
Time difference of 1.000278 hours
Now, the 26th of October was the day that change to the standard time
occurred, so I suspect that this has something to do with that. In fact
> dd1
[1] "2003-10-26 00:59:59 Central Daylight Time&quo...
2013 Nov 17
1
FactoMineR
...l conditions
que se me corrían a la derecha creándome una columna más. Corregido esto
(dentro del archivo csv) procedí como sigue y todo corrió aparentemente
bien:
dd<-read.csv('mortality_modificado.csv') # modificado sin mucho cuidado. En
tu caso debes adecuarlo bien a tus necesidades
dd2<-dd[,2:19]
rownames(dd2)<-dd[,1]
colnames(dd2)<-colnames(mortality)
res<-MFA(dd2,group=c(9,9),type=c("f","f"), name.group=c("1979","2006"))
Ojalá te sea de ayuda.
¡Salud!
2013/11/17 Carlos Ortega <cof en qualityexcellence.es>
> Hol...
2012 Aug 06
1
more efficient way to parallel
...rm(n=1000, rep(0, 10), Sigma)
xlist <- list()
for (j in 1:1000)
{
xlist[[j]] <- list(X = matrix( x [j, ],5))
}
## end of initialization
dd1 <- sapply(xlist,function(s) {min(abs((eigen(s$X))$values))})
##
sumdd1=sum(dd1)
for (j in 1:1000)
{
xlist[[j]]$dd1 <- dd1[j]/sumdd1
}
## Assume dd2 and dd1 can not be combined in one sapply()
dd2 <- sapply(xlist, function(s){min(abs((eigen(s$X))$values))+s$dd1})
result.seq[i] <- sum(dd1*dd2)
}
[[alternative HTML version deleted]]
2014 Jul 21
2
Inserción de condicionales en pequeño código
..."auto")/365.25,1))
mayor_t_Apertura$fent <- Apertura
dd1.new
<- rbind(menor_t_Apertura, mayor_t_Apertura)
dd1.new <- dd1.new[,-which(names(dd1.new)
%in% c('edad_Apertura'))]
### 2) Si
"finicio" es POSTERIOR a la fecha de Apertura ###
dd2 <- data[ data$finicio >
Apertura,] ; dd2$edad_fent <- NA ; dd2$fent <- NA
##### Resultado #####
union <- rbind(dd1.new, dd2) ; union <- union[with(union, order(id)), ] ; return(union)
} # FINAL DE LA FUNCIÓN
myfun(DF)
[[alternative HTML versio...
2007 Apr 19
1
Character coerced to factor and I cannot get it back
...d[,3]) ; id
# get site designators (first one or two characters of
id
st <- substring(id, 1,nchar(id)-4 ) ; st
typeof (st) ; class(st)
dd1 <- cbind(dd, st)
names(dd1) <- c("aa","bb","cc","st")
dd1
typeof(dd1$st); class(dd1$st)
dd2 <- cbind(dd, as.character(st))
names(dd2) <- c("aa","bb","cc","st")
dd2
typeof(dd2$st) ; class(dd2$st)
2011 Aug 24
1
silently testing for data from another package for .Rd examples
...can incorporate such a data example silently without
errors or warnings if the
package doesn't exist, as is the case with require()?
> data(prostate, package="ElemStatLearn")
> dd <- data(prostate, package="ElemStatLearn")
> dd
[1] "prostate"
> dd2 <- data(xxxxx, package="ElemStatLearn")
Warning message:
In data(xxxxx, package = "ElemStatLearn") : data set 'xxxxx' not found
> dd2
[1] "xxxxx"
> dd2 <- data(xxxxx, package="ElemStatLearn", verbose=FALSE)
Warning message:
In data(xxxxx...
2008 Mar 24
1
Great difference for piecewise linear function between R and SAS
...6 2.861 -
3.920 8.86e-05 ***
#SAS codes
data b;
set a;
if distance > 16.13 then d1=1; else d1=0;
distance2=d1*(distance - 16.13);
if distance > 24 then d2=1; else d2=0;
distance3=d2*(distance - 24);
if y>-0.4357 then dd1=1; else dd1=0;
y2=dd1*(y+0.4357);
if y>-0.3202 then dd2=1; else dd2=0;
y3=dd2*(y+0.3202);
run;
proc logistic descending data=b;
model mark =x elevation elevation*elevation distance distance2 distance3 y
y2 y3;
run;
The LOGISTIC Procedure Analysis of Maximum Likelihood
Estimates
St...
2007 Apr 19
0
Fwd: RE: Character coerced to factor and I cannot get it back
...substring(id, 1,nchar(id)-4 ) ; st typeof
> > (st) ; class(st)
> >
> > dd1 <- cbind(dd, st)
> > names(dd1) <- c("aa","bb","cc","st")
> > dd1
> > typeof(dd1$st); class(dd1$st)
> >
> > dd2 <- cbind(dd, as.character(st))
> > names(dd2) <- c("aa","bb","cc","st")
> > dd2
> > typeof(dd2$st) ; class(dd2$st)
> >
> > ______________________________________________
> > R-help at stat.math.ethz....
2003 Jan 13
2
replace NA´s
hey
what should I do to replace in a data frame NA?s with zeroes?
Thanks in advance
Juan Pablo
2007 Apr 20
0
Fwd: Re: Character coerced to factor and I cannot get it back
...> > > > > dd1 <- cbind(dd, st)
> > > > > names(dd1) <- c("aa","bb","cc","st")
> > > > > dd1
> > > > > typeof(dd1$st); class(dd1$st)
> > > > >
> > > > > dd2 <- cbind(dd, as.character(st))
> > > > > names(dd2) <- c("aa","bb","cc","st")
> > > > > dd2
> > > > > typeof(dd2$st) ; class(dd2$st)
> > > > >
> > > > >
> ______...
2008 Apr 14
3
Doing the right amount of copy for large data frames.
...t@store)
.Object@nrow <- nrow(.Object@data)
.Object@ncol <- ncol(.Object@data)
.Object@data <- data.frame( )
.Object
})
### Usage:
nn <- 10
## dd1 below could possibly be created by read.table or scan and data.frame
dd1 <- data.frame(xx = rnorm(nn), yy = rnorm(nn))
dd2 <- new('DataFrame', data = dd1)
rm(dd1)
## Now work with dd2
Thanks a lot,
Gopi Goswami.
PhD, Statistics, 2005
http://gopi-goswami.net/index.html
[[alternative HTML version deleted]]
2011 Aug 23
0
Matrix:::qr.qy and signature(qr = "sparseQR", y = "dgCMatrix")
...e for use with sparse matrices. But the method qr.qy does not seem to have a function available for the following signature: signature(qr = "sparseQR", y = "dgCMatrix") - although it indicates that it understands this signature.
Following is a minimal example (in my application dd2 is too large for my memory):
library(Matrix)
data(KNex);
mm <- KNex$mm
mmQR <- qr(mm)
dim(mmQR) # 1850 712
class(mmQR) # [1] "sparseQR";attr(,"package");"Matrix"
dd1 <- sparseMatrix(1:ncol(mm),1:ncol(mm), x = 1, dims = c(nrow(mm),ncol(mm)))
class(dd1...
2023 Oct 14
2
Create new data frame with conditional sums
Well, here's one way to do it:
(dat is your example data frame)
Cutoff <- seq(0, .15, .01)
Pop <- with(dat, sapply(Cutoff, \(p)sum(Totpop[Pct >= p])))
I think there must be a more efficient way to do it with cumsum(), though.
Cheers,
Bert
On Sat, Oct 14, 2023 at 12:53?AM Jason Stout, M.D. <jason.stout at duke.edu> wrote:
>
> This seems like it should be simple but I
2007 Mar 08
1
chronological scatterplots
Greets Folks,
I've been wrestling with how to better control plotting of time data and
just can't seem to see the right path. My dataset has thousands of points
distributes across a number of years. I would like to plot the responses
according to increasing time with nice boundaries - perhaps integer months
- along the abscissa. However, the earliest time occurs mid-month and I
2009 May 20
2
How to load data from Statistics Canada
We would like to load data from Statistics Canada
(http://www.statcan.gc.ca/) using R,
for example, Employment and unemployment rates.
It seems to me that the tables are displayed in HTML.
I was wondering if you know how to load these tables. Thanks,
-james
2006 Mar 11
2
weird! QDA does not depend on priors?
Hi all,
If I run LDA on the same data (2-class classification) with default(no
priors specified in the lda function) vs. "prior=c(0.5, 0.5)", the results
are different.
The (0.5, 0.5) priors give better 1-classify-to-1 rate, and the proportional
priors(default, no priors specified in the lda function) give better
0-classify-to-0 rate, for both training and testing data sets.
However,
2007 Apr 13
5
new machine just turns off after some time.
...ime when I first started....
I immediately jumped into the hardware monitor for CPU temp and it is
registering 45C.
around 114 F. Seems OK at this point..
I have heard before RAM or power supply.
Do these symptoms still point to that?
Does the power supply seem more likely than RAM? The RAM is DD2 Corsair.
I am doubtful that the kernel just died or something for froze as the
machine TURNS OFF.
THanks for any tips.
Jerry