similar to: Vector Manipulation

Displaying 20 results from an estimated 10000 matches similar to: "Vector Manipulation"

2006 Jun 20
2
glm beta hypothesis testing
In summary.glm I'm trying to get a better feel for the z output. The following lines can be found in the function 1 if (p > 0) { 2 p1 <- 1:p 3 Qr <- object$qr 4 coef.p <- object$coefficients[Qr$pivot[p1]] 5 covmat.unscaled <- chol2inv(Qr$qr[p1, p1, drop = FALSE]) 6 dimnames(covmat.unscaled) <- list(names(coef.p), names(coef.p))
2006 May 12
3
Maximum likelihood estimate of bivariate vonmises-weibulldistribution
Thanks Dimitris!!! That's much clearer now. Still have a lot of work to do this weekend to understand every bit but your code will prove very useful. Cheers, Aziz -----Original Message----- From: Dimitrios Rizopoulos [mailto:Dimitris.Rizopoulos at med.kuleuven.be] Sent: May 12, 2006 4:35 PM To: Chaouch, Aziz Subject: RE: [R] Maximum likelihood estimate of bivariate
2008 Jul 25
3
Help with rep
Hi Is it possible to use the rep command (or maybe some other "shortcut") to create a vector with the following format: 4 3 4 2 3 4 1 2 3 4 Any help is much appreciated. Thanks Jacob Jacob L van Wyk Department of Statistics University of Johannesburg, APK Box 524 Auckland Park 2006 South Africa Office Tel: +27 11 559 3080 Fax: +27 11 559 2832 [[alternative HTML version
2006 Sep 22
2
A simple resampling problem
Dear UseRs I would like to show my students how to use "resampling" to solve the following simple problem: If a family has two children of which one is a boy, what is the probability that the other child is also a boy. The answer is (obviously) 1/3, and can be show easily using the usual methods. But I would like to get the students to think of resampling, by doing the following:
2007 Aug 20
1
Select rows of matrix
Hi I would appreciate if anyone could help me with an elegant solution of the following: I have a matrix that contain a small number of -Inf values. How can form a new matrix from the old one that excludes all the rows with -Inf values ? Thank you. Jacob Dept of Statistics University of Johannesburg South Africa [[alternative HTML version deleted]]
2007 Apr 16
2
Matrix manipulation
Hi, This is a very basic question, but apparently I am too stupid for it. I have a large matrix A, and I need to avoid for loops. How could I apply a function f(a,r,c) on each element of A, using the subscript (row and column) of a as the other arguments? Thanks in advance, Markku Karhunen National Public Health Institute, Finland
2005 Oct 20
2
String manipulation
R-help, I have a data frame which contains a character string column that is something like; II11 II18 II23 III1 III13 III16 III19 III2 III7 IV10 IV11 IV12 IX16 IX4 V12 V18 V2 V20 V23 V4 VII14 VII18 VII21 VII26 VII28 VII33 VII4 VII48 VII5 .... .... .... I want to apply a function (e.g mean) by grouping according to the roman part of the string, i.e, by I by V by VII ... ... and so on. I have
2007 Sep 29
3
Data manipulation
Hello, I am beginner in R and I would like to solve the following problem: Suppose that we have three files to be red in R d1, d2, and d3 > d1 id x1 x2 1 1 4 n 2 2 3 h 3 3 0 f > d2 id x1 x2 1 1 2 r 2 2 3 u 3 3 1 f > d3 id x1 x2 1 1 2 a 2 2 1 w Is there any library or function that one can read this datasets like for(i in 1:3) d[i] <-
2007 Dec 20
2
factor manipulation: edgelist to a matrix?
Hello All, I have had considerable bad luck with attempting the following with for loops. Here is the problem: # Suppose we have a data.frame with the following data, which can be considered a type of edgelist (for those with networks backgrounds): # # V1 V2 # 1 A # 1 A # 1 B # 2 A # 3 C # 3 A # 3 C # 3 B # # I want the output of the function to produce a matrix, such that #each factor of
2008 Apr 09
4
apply lm() for all the columns of a matrix
Hi all, My question is not really urgent. I can write a loop and solve the problem. But I know that I'll be in a similar situation many more times so it would be useful to find out the answer Is there a fast way to perform linear fit to all the columns of a matrix? (or in the one dimension of a multi-dimensional array.) I'm talking about many single linear fits, not about a multiple fit.
2005 Sep 25
2
getting variable length numerical gradient
Hi all. I have a numerical function f(x), with x being a vector of generic size (say k=4), and I wanna take the numerically computed gradient, using deriv or numericDeriv (or something else). My difficulties here are that in deriv and numericDeric the function is passed as an expression, and one have to pass the list of variables involved as a char vector... So, it's a pure R programming
2006 Mar 02
2
'...' passed to both plot() and legend()
Dear R-devels, I'd like to create a plot method for a class of objects that passes the '...' argument to both plot() and legend(), e.g., x <- list(data = rnorm(1000)) class(x) <- "foo" plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL, ...){ dx <- sort(x$data) plot(dx, dnorm(dx), type = "l", ...) if (legend)
2005 May 19
2
plot question
hi all: xlim and ylim are used to define the interval limits of a plot. I'm interested in the scale of values between this limits. suppose xlim=c(0,10) we can have e.g. 0 5 10 0 2 4 6 8 10 0 1 2 3 4 5 6 7 8 9 10 which is the parameter that allows me to modify this? thanks in advance alexandre
2007 Jan 21
5
Integration + Normal Distribution + Directory Browsing Processing Questions
Hi everyone, I am new to R, but it's really great and helped me a lot! But now I have 2 questions. It would be great, if someone can help me: 1. I want to integrate a normal distribution, given a median and sd. The integrate function works great BUT the first argument has to be a function so I do integrate(dnorm,0,1) and it works with standard m. and sd. But I have the m and sd given.
2006 Nov 09
4
Plotting symbols with two positions?
Thanks a lot to Demitris for a prompt answer some minutes ago on another tread (see below). To avoid excess mails on the list, I move onto next question: I have another small plotting problem that confuses me. I want to plot results from a field trial series, using the numbers of the trials as symbols in the plot. pch = as.character(trial_no) works fine, but truncates the trial number to the
2005 Jan 21
2
chi-Squared distribution
Dear Rs: outer(1:3, 1:3, function(df1, df2) qf(0.95, df1, df2)) I compare this F distribution results with the table, the answers were perfect. But I need to see for chi-sqaured distribution. When I employed the similar formula outer(1:3, 1:3, function(df1, df2) qchisq(0.95, df1, df2)) , I am getting unexpected results. I need to see the following values: p=0.750 ..... 1 1.323
2004 Jun 25
3
String manipulation
Hi, let's see, if someone can help my with this one: I have the string as follows: > str<-("one","two","three") Now I want to concatenate the items to one string, seperateted by space or something else, >str >"one, two, three" If possible without a loop. My actual goal ist to create string like >str.names >"female = names1, male
2004 Aug 26
5
GLMM
I am trying to use the LME package to run a multilevel logistic model using the following code: ------------------------------------------------------------------------ ------------------------------------------- Model1 = GLMM(WEAP ~ TSRAT2 , random = ~1 | GROUP , family = binomial, na.action = na.omit ) ------------------------------------------------------------------------
2008 Jan 02
2
Multivariate response methods question
Hi Everyone, I have some data that predicts both a nominal and ordinal response variable. I was wondering what packages in R would help me analyze the data? I was also curious if anyone could recomend me some textbooks that would help with the analysis of such data? I have the 5th edition of "Applied Multivariate Statistical Analysis" by Richard A. Johnson and Dean W. Wichern
2005 Jan 21
2
chi-Squared distribution in Friedman test
Dear R helpers: Thanks for the previous reply. I am using Friedman racing test. According the the book "Pratical Nonprametric Statistic" by WJ Conover, after computing the statistics, he suggested to use chi-squared or F distribution to accept or reject null hypothesis. After looking into the source code, I found that R uses chi-sqaured distribution as below: PVAL <-