similar to: Specify a minimum number of valid arguments for the mean function

Displaying 20 results from an estimated 40000 matches similar to: "Specify a minimum number of valid arguments for the mean function"

2010 Dec 01
4
Sequence for repeated numbers
Hello fellows, I would like to create a sequence for repeated numbers in a dataset. For example: ID <- c(1:20) grade <- c(4,4,4,5,5,7,7,7,7,8,8,8,9,9,9,9,9,10,10,10) Data: ID Grade 1 4 2 4 3 4 4 5 5 5 6 7 7 7 8 7 9 7 (...) I would like to create a variable "sequence": Data: ID Grade Sequence: 1 4 1 2 4 2 3 4 3 4 5
2011 Feb 01
1
Lmer binomial distribution x HLM Bernoulli distribution
Dear R-users, I'm running a lmer model using the lme4 package. My dependent variable is dichotomous and I'm using the "binomial" family. The results are slightly different from the HLM results based on a Bernoulli distribution. I read that a Bernoulli distribution is an extension of a binomial distribution. Is that right? If so, how can I adapt my R model to a Bernoulli
2008 Jan 01
2
Non-Linear Quantile Regression
Please, I have a problem with nonlinear quantile regression. My data shows a large variability and the quantile regression seemed perfect to relate two given variables. I got to run the linear quantile regression analysis and to build the graph in the R (with quantreg package). However, the up part of my data dispersion seems a positive exponential curve, while the down part seems a negative
2010 Sep 22
0
reliability of the level-1 random coefficients (lme4)
Hello everyone, I want to estimate the reliability *of the level*-*1 random coefficients (the one *reported in the HLM output) using the software R. Does anyone know how to get this statistic from R? I'm using the function "lmer" of the package "lme4" to estimate multilevel models. I tried to use the formula but I can't find specific information such as the sigma
2007 Mar 30
2
Minimum valid number of observations for rpart
Hi, I wonder if anyone knows a study dealing with the minimum valid number of observations when using CART?. On top of that, when using RandomForest, is it possible to obtained a interpretable tree model as the graphical output of the analysis, just like in "rpart"? Thanks a lot in advance Javier Lozano Universidad de Le?n Spain
2005 Nov 03
1
Specify Z matrix with lmer function
Is there a way to specify a Z matrix using the lmer function, where the model is written as y = X*Beta + Z*u + e? I am trying to reproduce smoothing methods illustrated in the paper "Smoothing with Mixed Model Software" my Long Ngo and M.P. Wand. published in the /Journal of Statistical Software/ in 2004 using the lme4 and Matrix packages. The code and data sets used can be found at
2013 May 29
0
Lista dos aprovados em concurso Lagoa da Canoa
Lista dos aprovados em concurso Lagoa da Canoa: V?rzea Grande: ANA MARA DE SOUSA PEREIRA, LUANA FERNANDA FERNANDES ANDRADE, FRANCISCO ROGER GARCIA DE ALMEIDA, POLLYANNA DE O, JO?O CARLOS MOREIRA DE CARVALHO, DANIELLA FERNANDES DA SILVA, MARIA JOS? DA SILVA FERREIRA, J?SSICA VENTURA FREIRE. SOLANGE PAULINO CORREIA, BRUNA KETHEY DA SILVA PEIXOTO, LUIS HENRIQUE FREITAS GOMES, HELIO SOARES DE ARAUJO,
2010 Jan 26
2
tapply and more than one function, with different arguments
Dear R-users, I am working with R version 2.10.1. Say I have is a simple function like this: > my.fun <- function(x, mult) mult*sum(x) Now, I want to apply this function along with some other (say 'max') to a simple data.frame, like: > dat <- data.frame(x = 1:4, grp = c("a","a","b","b")) Ideally, the result would look something like
2010 Mar 12
1
using xval in mvpart to specify cross validation groups
Dear R's I'm trying to use specific rather than random cross-validation groups in mvpart. The man page says: xval Number of cross-validations or vector defining cross-validation groups. And I found this reply to the list by Terry Therneau from 2006 The rpart function allows one to give the cross-validation groups explicitly. So if the number of observations was 10, you could use
2011 May 17
2
Minimum value by ID
Hello, I have a longitudinal dataset where each individual has a different number of entries. Thus, it is of the following structure: x <- runif(12) id.var <- factor(c(rep("D1",4),rep("D2",2),rep("D3",3),rep("D4",3))) dat <- as.data.frame(x) dat$id.var <- id.var dat > dat x id.var 1 0.9611269 D1 2 0.6738606 D1 3
2010 Jun 08
2
how to ignore rows missing arguments of a function when creating a function?
Hi, I am relatively new to R; when creating functions, I run into problems with missing values. I would like my functions to ignore rows with missing values for arguments of my function) in the analysis (as for example is the case in STATA). Note that I don't want my function to drop rows if there are missing arguments elsewhere in a row, ie for variables that are not arguments of my
2010 Apr 19
2
nls minimum factor error
Hi, I have a small dataset that I'm fitting a segmented regression using nls on. I get a step below minimum factor error, which I presume is because residual sum of square is still "not small enough" when steps in the parameter space is already below specified/default value. However, when I look at the trace, the convergence seems to have been reached. I initially thought I might
2011 Sep 08
3
How to specify a variable name in the regression formula without hard coding it
I have a matrix called mat and y is the column number of my response and x is a vector of the column numbers of my terms. The variable name of y can change, so I don't want to hardcode it. I can find out the name as follows: > names(mat)[y] [1] "er12.l" Then I can run the regression by hard coding the variable name as follows: > mod <-
2011 Apr 06
3
Calculated mean value based on another column bin from dataframe.
Dear list, I have a dataframe with two column as fellow. > head(dat) V1 V2 0.15624 0.94567 0.26039 0.66442 0.16629 0.97822 0.23474 0.72079 0.11037 0.83760 0.14969 0.91312 I want to get the column V2 mean value based on the bin of column of V1. I write the code as fellow. It works, but I think this is not the elegant way. Any suggestions?
2011 Aug 25
1
Specifying argument values in a function
Hello all, I am trying write a fairly simple function that provide a quick way to calculate several distributions for a data set. I am trying to provide a function that has a argument that specifies which distribution is outputted (here "norm" or "cumu"). I also have a melt argument but that seems to be working fine. I have been able to get my function working well for just
2007 Nov 01
2
computing the mean of a few variables
hello, I have a simple question: I want to compute the average of 6 variables, my data looks like this: t0 t1 t2 t3 t4 t5 1 32 34 36 40 38 40 2 35 37 38 36 33 39 . . . I want the mean of t0-t5 for each row (observation). thank you, sigalit. [[alternative HTML version deleted]]
2008 Jun 11
1
computing and showing mean
Hello to everyone, I am trying to compute a mean and show it to the screen and then save to later be used as a boxplot.I have used the following code: dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt",header=T,row.names=1) file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\Yeast\\Yeast.txt") x<-dat[2,23:46]
2011 Apr 04
1
moving mean and moving variance functions
Hello Lets say as an example I have a dataframe with the following attributes: rownum(1:405), colnum(1:287), year(2000:2009), daily(rownum x colnum x year) and foragePotential (0:1, by 0.01). The data is actually stored in a netcdf file and I'm trying to provide a conceptual version of the data. Ok. I need to calculate a moving mean and a moving variance for each cell on the following
2005 May 25
2
weighted.mean and tapply (again)
I read answers to questions including the words "tapply" and "weighted.mean", but I didn't understand either the problem (data) or the solution provided. Here is my question ... > dat[1:10,] GROUP VALUE FREQUENCY 1 2 2 78 2 2 3 40 3 2 4 16 4 2 5 3 5 2 6 1 6 2 8 1 7
2010 Oct 13
1
Pasting function arguments and strings
Dear R community, I am struggling a bit with a probably fairly simple task. I need to use some already existing functions as argument for a new function that I am going to create. 'dataset' is an argument, and it comprises objects named 'mean_test', 'sd_test', 'kurt_test' and so on. 'arg1' tells what object I want (mean, sd, kurt) while 'arg2' tells