similar to: question about mean

Displaying 20 results from an estimated 11000 matches similar to: "question about mean"

2008 Aug 23
2
how to call a C-library in R
Hi, everyone, I need to use a C library. But since I have little experience in C, I want to call this C library in R and program the rest in R. Does anyone know how to do this? Thanks, Cindy [[alternative HTML version deleted]]
2009 Nov 15
4
pairs
Hi, All, I have an n by m matrix with each entry between 1 and 15000. I want to know the frequency of each pair in 1:15000 that occur together in rows. So for example, if the matrix is 2 5 1 6 1 7 8 2 3 7 6 2 9 8 5 7 Pair (2,6) (un-ordered) occurs together in rows 1 and 3. I want to return the value 2 for this pair as well as that for all pairs. Is there a fast way to do this avoiding loops?
2011 Apr 09
1
integration
Hi, All, I have a density function with 3 variables which is defined on some irregular domain, and I want to get the marginal distribution of each variable. Is there any function doing this? A simple example is p(x,y,z)=x*y*z*I(xy>z). So each marginal distribution is a function of the other two variables. My density form is very complicated, so I cannot do it by hand. I was just wondering if
2009 Aug 10
2
matrix power
Hi, All, If I have a symmetric matrix, how can I get the negative square root of the matrx, ie. X^(-1/2) ? Thanks, Cindy [[alternative HTML version deleted]]
2009 Jul 27
2
local regression using loess
Hi, All, I have a dataset with binary response ( 0 and 1) and some numerical covariates. I know I can use logistic regression to fit the data. But I want to consider more locally. So I am wondering how can I fit the data with 'loess' function in R? And what will be the response: 0/1 or the probability in either group like in logistic regression? Thank you, Cindy [[alternative HTML
2009 Jul 29
2
install package from CRAN
Hi, I have a very basic question about install packages from CRAN on unix. I only installed on Windows before. Should I use the command install.package? The error message I got is syntax error near unexpected token `"mvtnorm"' Is it because I didn't set the path? Which path should I specify? Thanks, Cindy [[alternative HTML version deleted]]
2008 Jul 24
1
R-package install
Hi, I have a R package, which is a .tar.tar file. And it is said to be source code for all platforms. And the author said it should install on any system (but he didn't know about Windows). I am wondering if I can use this package in Windows R. Thank you, Cindy [[alternative HTML version deleted]]
2008 Jul 23
2
truncated normal
Hi, I want to generate random samples from truncated normal say Normal(0,1)Indicator((0,1),(2,4)). It has more than one intervals. In the library msm, it seems to me that the 'lower' and 'upper' arguments can only be a number. I tried rtnorm(1,mean=0,sd=1, lower=c(0,2),upper=c(1,4)) and it didn't work. Can you tell me how I can do truncated normal at more than one intervals?
2009 Jul 26
1
normal mixture model
Hi, All, I want to fit a normal mixture model. Which package in R is best for this? I was using the package 'mixdist', but I need to group the data into groups before fitting model, and different groupings seem to lead to different results. What other package can I use which is stable? And are there packages that can automatically determine the number of components? Thank you, Cindy
2005 Dec 21
3
NextMethod causes R 2.2.0 to crash (PR#8416)
I found writing the following default method the for the generic function "julian" causes R to crash. julian.default <- function(x, ...) { x <- as.Date(x) NextMethod("julian", x, ...) } Here is a test example > m <- as.Date("1972-09-27") + 0:10 > m [1] "1972-09-27" "1972-09-28" "1972-09-29"
2008 Feb 13
2
apply on large arrays
I have a big contingency table, approximately of size 60*2*500*500, and I need to count the number of cells containing a count of 1 for each of the factors values defining the first dimension. Here is my attempt: tab1<-with(pisa1,table(CNT,GENDER,ISCOF,ISCOM)) tab2<-apply(tab1,1:4,function(x)ifelse(sum(x)==1,1,0)) tab3<-apply(tab2,1,sum) Computing tab2 is very slow. Is there a faster
2006 Dec 22
5
substitute creates an object which prints incorrectly (PR#9427)
The function "substitute" seems to fail to make a genuine substitution, although the printed verision seems fine. Here is an example. > m <- substitute(Y <- function(x) FUN(x+1), + list(Y = as.name("y"), FUN = as.name("sin"))) > m y <- function(x) sin(x + 1) > eval(m) > y function(x) FUN(x+1) However the story doesn't end there. The
2005 Apr 30
3
as.numeric method for objects of class "difftime"
I have just become painfully aware that objects of class "difftime", generated by the difference of two POSIXct objects, carry a "units" attribute, which flashes by when the object is printed, for example. The pain was occasioned when I tried to turn these objects into numberic objects for use elsewhere as a covariate. as.numeric(difftime object) simply turns off the units
2008 Feb 01
6
Accessing the elements of a list
Hi R, I wanted to know how do we access the elements of a list. In particular, v=list(c(1,2,3,4,5),c(1,2,33,4,5),c(1,2,333,4,5),c(1,2,3333,4,5)) I want to access all the thirds items of the elements of the list. i.e., I want to access the elements, 3,33,333,3333. This can be done through sapply as: sapply(v,function(x) x[3]) But I need to access this without using
2007 Jul 03
1
termplot - changes in defaults
While termplot is under discussion, here's another proposal. I'd like to change the default for partial.resid to TRUE, and for smooth to panel.smooth. I'd be surprised if those changes were to break existing code. John Maindonald email: john.maindonald at anu.edu.au phone : +61 2 (6125)3473 fax : +61 2(6125)5549 Centre for Mathematics & Its Applications, Room
2009 Mar 31
4
Convert Character to Date
Hello, I have a date in the format Year-Month Name (e.g. 1990-January) and R classes it as a character. I want to convert this character into a date format, but when I try as.Date(1990-January, "%Y-%B"), I get back NA. The function strptime also gives me NA back. Thanks. [[alternative HTML version deleted]]
2006 Jan 14
2
initialize expression in 'quasi' (PR#8486)
This is not so much a bug as an infelicity in the code that can easily be fixed. The initialize expression in the quasi family function is, (uniformly for all links and all variance functions): initialize <- expression({ n <- rep.int(1, nobs) mustart <- y + 0.1 * (y == 0) }) This is inappropriate (and often fails) for variance function "mu(1-mu)".
2008 Aug 06
4
How to calculate GLM least square means?
Hello R-helpers, I would like to calculate least square means after having built a GLM with quasipoisson errors. In my model the dependent variable is continuous, I have one continuous independent variable and one categorical independent variable (that is the variable for which I would like to calculate the least square means). I've looked around for the command to calculate the least
2000 Oct 02
9
the underscore ("_") in variable name
At 14:35 02/10/00 +0800, mohd zamri wrote: >new to R and starting to learn to program R. The underscore ("_") did some >suprising result. e.g > >> c <- c(1,2,3,4,5) >> mean(c) >[1] 3 >> c_mean <- mean(c) >> c >[1] 3 > >having some experience in C, I thought the underscore is "always" valid in >variable name. totally confuse
2007 Nov 15
3
generate combination set
I have a set data={A,B,C,D,E,F,G} I want to choose 2 letter from 8 letters, i.e. generate the combination set for choose 2 letters from 8 letters. I want to get the liking: combination set={AB,AC,AD,....} Does anyone konw how to do in R. thanks, Aimin