try this
Out - lm(A ~ data$B + data$C + data$D)
summary(Out)
moreover, by typing 'summary.lm' in your R console you may see how the
t-values are computed; check also ?summary.lm.
Another way, though less efficient, to obtain the standard errors is
the following
summ.Out - summary(Out)
X -
try this:
mat - array(1:3, dim = c(4, 5))
#
ind - table(apply(mat, 1, paste, collapse = /))
ind - which.max(ind)
as.numeric(strsplit(names(ind), /)[[1]])
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic
AFAIK there exist functions to fit IRT models only for ordinal data.
In particular, look at function grm() that fits the Graded Response
Model in the 'ltm' package (using Marginal Maximum Likelihood),
function PCM() in the 'eRm' package (using Condtional Maximum
Likelihood), and function
try this:
cor.mat - cor(iris[1:4])
cor.mat[lower.tri(cor.mat)]
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax:
look at
?factor
?formula
?data.frame
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web:
try this:
start.val - 2
end.val - 6500
system.time(res - unlist(lapply(start.val:end.val, :, to = end.val)))
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven,
maybe you're looking for:
cat(datadir)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web:
you can do that using the copula package, e.g.,
library(copula)
bivGamma - mvdc(claytonCopula(2), c(gamma, gamma),
list(list(shape = 1, rate = 2), list(shape = 2, rate = 1)))
dat - rmvdc(bivGamma, 1000)
regarding correlation, the Clayton copula with alpha = 2 gives
Kendall's tau =
look at summary.glm(), probably you're looking for
fit - glm(..., family = binomial)
# the inverse Fisher Information matrix
summary(fit)$cov.scaled
I hope it helps.
Best,
Dimitris
--
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of
Quoting Duncan Murdoch [EMAIL PROTECTED]:
On 9/21/2006 10:40 AM, Doran, Harold wrote:
Suppose I have a square matrix P
P - matrix(c(.3,.7, .7, .3), ncol=2)
I know that
P * P
Returns the element by element product, whereas
P%*%P
Returns the matrix product.
Now, P^2 also returns
Quoting Douglas Bates [EMAIL PROTECTED]:
On 9/21/06, Dimitrios Rizopoulos [EMAIL PROTECTED] wrote:
Quoting Duncan Murdoch [EMAIL PROTECTED]:
On 9/21/2006 10:40 AM, Doran, Harold wrote:
Suppose I have a square matrix P
P - matrix(c(.3,.7, .7, .3), ncol=2)
I know that
P * P
look at ?data.matrix()
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
you need something like the following,
fit.lis - list(model1, model2, model3, model4, model5)
# or if you have many models
fit.lis - lapply(paste(model, 1:5, sep = ), get)
sapply(fit.lis, function(x) summary(x)$r.squared)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
maybe the following is what you're looking for:
lead.dat[!duplicate(rownames(lead.dat)), ]
lead.dat[duplicate(rownames(lead.dat)), ]
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address:
try something like the following:
lis1 - c(lapply(1:10, rnorm, n = 10))
lis2 - c(lapply(1:10, rnorm, n = 10))
lis1[[5]] - lis2[[8]] - numeric(0)
ind - sapply(lis1, length) 0 sapply(lis2, length) 0
lis1 - lis1[ind]
lis2 - lis2[ind]
I don't think you can obtain these values directly since
plot.default() does not return something.
'ylim' is in fact calculated from xy.coords() as the range of the
finite 'y' abscissa values; check the code of plot.default() for more
info.
I hope it helps.
Best,
Dimitris
Dimitris
maybe something like:
%*~% - function(x, y){
n - nrow(x)
out - matrix(0, n, ncol(x) * ncol(y))
for(i in 1:n)
out[i, ] - c(y[i, ] %o% x[i, ])
out
}
x - matrix(1:4, 2, 2, TRUE)
y - matrix(5:8, 2, 2, TRUE)
x %*~% y
I hope it helps.
Best,
Dimitris
Dimitris
try the following:
data - data.frame(matrix(rnorm(900), ncol = 9))
names(data) - c(y, paste(x, 1:8, sep = ))
logr - lm(y ~ . - 1, data)
a - summary(logr)
coef(a)
coef(a)[, 3:4]
coef(a)[, t value]
coef(a)[, Pr(|t|)]
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Quoting John Kane [EMAIL PROTECTED]:
--- Dimitrios Rizopoulos
[EMAIL PROTECTED] wrote:
try the following:
mdf - data.frame(us.state, count, year, month)
mdf[order(mdf$year, mdf$month), ]
Thansk to Dimitris and Dieter. This has helped since
seems to have shown me a way around
try the following:
mdf - data.frame(us.state, count, year, month)
mdf[order(mdf$year, mdf$month), ]
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
if you want the first row for the unique 'aa' entries, try the following:
cc[!duplicated(cc$aa), ]
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
?findInterval() could be of help in this case.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web:
I'd compute this in the log-scale (taking also advantage of the 'log'
and 'log.p' arguments of dnorm() and pnorm(), respectively), and then
transform back, e.g.,
fn1 - function(B){
-(pnorm(B) * dnorm(B) * B + dnorm(B)^2)/pnorm(B)^2
}
fn2 - function(B){
p1 - dnorm(B, log = TRUE) +
probably ?cut() is what you're looking for, e.g., something like:
ind - cut(mydata$soiltem, seq(0, 60, 0.2), labels = FALSE)
seq(0.1, 60, 0.2)[ind]
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of
probably you want to look at the help page of ?contr.treatment
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax:
I'm not aware of package for amino acid sequence analysis, but it'd
better to search yourself using, e.g., RSiteSearch() and help.search().
Regarding your question consider the following:
strg1 - c(AAA, AA, )
strg2 - c(BBB, , BBB)
strg - paste(strg1, strg2, sep = )
nA - nchar(gsub(B, ,
try the following:
x - c(B, F, N, Y)
y - numeric(length(x))
y[x != N] - 1
y
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel:
one approach is the following:
math - c(80, 75, 70, 65, 65, 70)
reading - c(65, 70, 88, NA, 90, NA)
id - c('001', '001', '001', '002', '003', '003')
score - data.frame(id, reading, math)
#
ind - cumsum(tapply(score$id, score$id, length))
score[ind, ]
I hope it helps.
Best,
Dimitris
maybe you could consider something like the following:
varlabs - function(x){
if (is.null(names(x))) NULL else x[!duplicated(x)]
}
varlabs- - function(x, value){
names(x) - names(value[x])
x
}
###
x - c(1, 2, 3, 3, 2, 3, 1)
x
varlabs(x)
varlabs(x) - c(apple=1, banana=2,
probably you want to look at the `lend' argument of ?par, e.g.,
op - par(lend = 2)
plot(c(1,2), c(1,1), xlim = c(0,3), lwd = 20, type = l)
par(op)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Quoting Renaud Lancelot [EMAIL PROTECTED]:
Dear all,
I am trying to avoid the warnings produced by:
x - -2:2
log(x)
[1] NaN NaN -Inf 0.000 0.6931472
Warning message:
production de NaN in: log(x)
I thought that using ifelse would be a solution, but it is not
according to ?.Random.seed, `Note' section, different R sessions give
differen simulation results; maybe each time you start R you load a
previously saved workspace, with an existing .Random.seed, i.e., check
if the .Random.seed value is the same each time you start R.
I hope it helps.
Best,
look at ?paste().
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
you could try something like:
ifelse(df 30, 30, ifelse(df 60, 60, df))
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax:
as an alternative, you can have a look inside cut.default and use the
part that produces the breaks, i.e.,
breaks - 10
groups - cut(x, breaks = breaks)
max.bias - as.vector(tapply(error, groups, mean))
# from cut.default()
nb - as.integer(breaks + 1)
dx - diff(rx - range(x, na.rm = TRUE))
maybe merge() is what you're looking for, e.g.,
dat - data.frame(x = rnorm(10), v1 = gl(5, 2), v2 = rep(1:2, 5))
ids - data.frame(v1 = c(2, 3, 4), v2 = c(1, 2, 1))
#
dat
merge(dat, ids)
I hope it helps.
Best,
Dimitris
--
Dimitris Rizopoulos
Ph.D. Student
probably ?reshape() could be used in this case; I hope it helps.
Best,
Dimitris
--
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web:
your code works for me, e.g.,
x1 - 1159 1129 1124 -5 -0.44 -1.52
x2 - c(1159, 1129, 1124, -5, -0.44, -1.52)
x3 - unlist(strsplit(x1, ))
all.equal(x2, x3)
[1] TRUE
as.numeric(x2)
[1] 1159.00 1129.00 1124.00 -5.00 -0.44 -1.52
as.numeric(x3)
[1] 1159.00 1129.00 1124.00
the problem you get comes from the fact that you attach the
data.frame, e.g., it can be re-produced by:
x1 - rnorm(30)
dat - data.frame(x1 = rnorm(30))
attach(dat)
look at ?attach for more details; you could consider with() as an
alternative.
I hope it helps.
Best,
Dimitris
--
Dimitris
probably you need ?paste, e.g.,
paste(1:500, collapse = ,)
I hope it helps.
Best,
Dimitris
Quoting Søren Merser [EMAIL PROTECTED]:
hi there
is there a way that i can coerce a vector of integers to ONE string
with
the numbers comma separated like:
1:500 -1,2,3, ..., 500
i've
40 matches
Mail list logo