search for: alimadhi

Displaying 15 results from an estimated 15 matches for "alimadhi".

2005 Dec 13
1
sample matrix
Please, I??d like to store this sample matrix as a new object. How can I do this ? pulse <- c(67, 67, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71, 71, 72, 72, 73, 74) m <- NULL x <- 0 for (i in 1:5) { x <- sample(pulse,3) m <- mean(x) cat(x,m,"\n") } Thanks, Mauricio
2006 Sep 29
3
if then else
What is the correct form to write statement meaning: if (a==1) {b=2; c=3}; else {b=0; c=0}; Thank you Jue Wang, Biostatistician Contracted Position for Preclinical & Research Biostatistics PrO Unlimited (908) 231-3022
2005 Apr 10
2
residuals in VGAM
Hi all: I want to fit a multinomial logit model with VGAM package, however I cannot find a way to check the residuals since residuals(my_model) and resid(my_model) does not work. Any suggestions? Thanks in advance. Alex Brito [[alternative HTML version deleted]]
2006 Oct 05
1
matrix multiplication
Dear all, I have 2 matrices, one is a 8x3 matrix, called X; the other matrix is a 3x3 indicator matrix with the diagonal element as 0 or 1. when a variable is included in the model, the corresponding diagonal element is 1, otherwise, it is 0. Let A be a set of matrices that contain the possible indicator matrix. e.g., A= [A1, A2, A3], where A1= [1,0,0;0,0,0,0,0,0], A2 =[1,0,0;0,1,0,0,0,0], A3
2006 Oct 05
1
convert day of week from number to character and include in lm
All, I am trying to include a day of week variable (1-7) in in a regression model. I would like to have the day of week treated as a categorical variable rather than a number the code looks like lm( dep ~ WKDY) I know this is a basic question, but help would be appreciated thanks spencer [[alternative HTML version deleted]]
2006 Oct 11
1
extracting rows
Hi, I have a matrix with few hundred by a few hundred and want to extract rows, e.g. (0,1,0), or (1.3, 2.4, 4). I made an example: > A = rep(rep(c(0,1),4),2) > B = rep(rep(c(0,1),each=4),2) > C = rep(rep(rep(c(0,1),2),each=2),2) > X = data.frame(A,B,C,rnorm(16)) A B C [1,] 0 0 0 0.72767870 [2,] 1 0 0 -0.09673298 [3,] 0 0 1 0.51192790 [4,] 1 0 1 -1.54350441 [5,] 0 1 0
2006 Oct 12
1
Should NA's in summary() output always be reported???
Consider > summary(1:5) Min. 1st Qu. Median Mean 3rd Qu. Max. 1 2 3 3 4 5 > summary(c(1:5,NA)) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's 1 2 3 3 4 5 1 Wouldn't it be more stringent if "NA's" was also reported in the first case?? Regards S?ren
2006 Jul 13
3
set the bahavior that R deal with missing values?
Dear Rusers, The default behavior in R when performing a regression model with missing values is to exclude any case that contains a missing value? How could i set the bahavior that R deal with missing values? e.g.: exclude cases listwise exclude cases pairwise replace with mean Thanks very much! -- Kind Regards, Zhi Jie,Zhang ,PHD Department of Epidemiology School of Public Health Fudan
2005 Dec 11
2
Problem with indexing (subscript out of bounds)
Hi, I am trying to index the rows of a model matrix where, due to missing values in the dataset used for the regression, the row numbers sometimes "jump" like this: > X[17:19,] (Intercept) PCINIFM 17 1 36.76471 19 1 13.23529 20 1 32.35294 So, the problem is if I select for example X[20, ], I actually get the 21th observation. I've tried to work
2005 Dec 14
2
Append tables
R Help: I have read a number of tables into R with identical headings and I would now like to make a single table that has all the data appended under this single heading line. for example: t1 <- read.csv("f1",header=TRUE) t2 <- read.csv("f2",header=TRUE) all <- c(t1,t2) #all is now twice as wide as t1 or t2 with the same number of row!!!! #I need to know how
2005 Dec 13
2
creating a subset of a dataset using ifelse statement?
I am using R in a Microsoft Windows environment. I have a dataset called “mp1b”. I have a variable called h. h can take a value from -1 to 5. If h <1, I want to create a new dataset called mp2 that is the same as mp1b: “mp2<-mp1b” If h > 0, I want to set create a dataset mp2, where I limit the original dataset to those where mp1b$group = =h. similar to:
2007 Jul 18
1
possible bug R CMD check: No space(s) allowed after \VignetteDepends{}
R CMD check gives an error when a vignette entry %\VignetteDepends{} has any extra space at the end. Maybe this is by design, but I found it confusing. Changing the function "vignetteMetaRE" in tools package could solve the problem. I.e. vignetteMetaRE <- function(tag) paste("[[:space:]]*%+[[:space:]]*\\\\Vignette", tag,"\\{([^}]*)\\}", sep = "")
2005 Dec 14
2
The fastest way to select and execute a few selected functions inside a function
Dear useRs? I have the following problem! I have a function that calls one or more functions, depending on the input parameters. I am searching for the fastest way to select and execute the selected functions and return their results in a list. The number of possible functions is 10, however usually only 2 are selected (although sometimes more, even all). For examples, if I have function
2005 Dec 07
4
Maintaining factors when copying from one data frame to another
Greetings all: OK, this is bugging the @#@%* out of me. I know the answer is simple and straightforward but for the life of me I cannot find it in the documentation, in the archives, or in my notes (because I know I've encountered this in the past). My problem is: I have a data frame with columns A, B, C, D, and E. A, B, and E are factors and C and D are numeric. I need a new data frame with
2006 Mar 08
6
Debugging a program written in the R language
>From Tom: The subject is debugging a program written in the R language,under Windows. (Sorry, but I do not know either the Apple OS or *nix.) A computer program will usually not work on the first try, if only because of the risk of typos. Instead, it must be debugged. Roughly, here is the sequence: (1) One codes a program using the R language, and stores it on the hard drive, using