Dear Bert
Thank you for your suggestion. I have tried it but it did not work.
For record, I am reposting the post with the plain text.
library(tidyverse)
library(plyr)
library(survey)
dat <- structure(list(
r3a_1 = structure(c(3L, 2L, 3L, 3L, 3L, 3L, 3L,3L, 3L, 3L, 3L, 2L,
2L, 3L, 3L, 3L, 3L
1. This is a plain text list. Set your email to post in plain text, not
html, which often gets mangled (see below).
2. I did not run your example, but try:
my_funca(mk =names(dat)[1:9], y = dat$seg_2)
## seg_2 is a component of dat and is not in the environment of the call. I
did not see any data
Dear R-Help
I am working with complex survey data using the survey package.
I would like to create a function for the generate multi crosstable. The
problem is that I am getting error with the following message:
"Error in eval(predvars, data, env) : object 'y' not found"
Here is the example:
libra
Hello everyone,
Does anybody know whether it's possible to calculate extract major axis
regression residuals on the results of a major axis Model II regression done by
lmodel2?
Many thanks,
Orca
Example :
> data1 data1
SSTo SSTp
1 17.21 20.36
2 19.61 20.19
3 18.60
...
and here is a maybe slightly neater approach using ?mapply (again with
the method column changed to character():
f <- function(meth,i,fr) do.call(meth,list((fr[i,])))
mapply(FUN=f,meth=input.df[,4],seq_len(nrow(input.df)),
MoreArgs = list(fr = input.df[,1:3]) )
Cheers,
Bert
Bert G
OOPS! I forgot to tell you that I first changed the "method" column,
which is a factor, to character, with
input.df$method <- as.character(input.df$method)
Then things will work properly.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking t
1. return() is not needed in R functions (it's harmless, however). You
might wish to go through an R function tutorial (many good ones are on
the web) to learn about what slick things you can do with functions in
R.
2. The following is just a brute force loop, so more elegant
approaches are likely
Hi all,
the function jtest allows to compare two non-nested models. The comparison
is made such that the fitted values of one model are included in the
regressor matrix of the other model. It then looks whether there is any
predictive power of these fitted values.
Unfortunately, the input has to
B.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=C LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC
On Fri, 17 Dec 2010, Iain Gallagher wrote:
Hello List
I'm moving this over from the bioC list as, although the problem I'm working on
is biological, the current bottle neck is my poor understanding of R.
I wonder if someone would help me with the following function.
Here is how I'd take it
Hello List
I'm moving this over from the bioC list as, although the problem I'm working on
is biological, the current bottle neck is my poor understanding of R.
I wonder if someone would help me with the following function.
cumulMetric <- function(deMirPresGenes, deMirs){
#need to match po
Hello Tim,
This function will do it where the covariates are provided as separate
arguments. It would be easy to modify this to handle a list too.
function(outcome, ...) {
arg.names <- as.character(match.call())[-1]
nargs <- length(arg.names)
f <- as.formula(paste(arg.names[1], "~", paste(a
Hello all
I have what seems like a simple question but have not been able to find an
answer on the forum. I'm trying to define a function which involves
regression models and a large number of covariates.
I would like the function to accept any number of covariates and, ideally, I
would like to b
Saji Ren wrote:
Thank you,man. the problem solved.
Plus. when I got the parameters of the data.
And I used the "truehist(mydata)" to get a histogram of the data,
How can I draw a line of the distribution of the estimated parameters in the
histogram plot?
for example:
fitdistr(na.exclude(mydat
Thank you,man. the problem solved.
Plus. when I got the parameters of the data.
And I used the "truehist(mydata)" to get a histogram of the data,
How can I draw a line of the distribution of the estimated parameters in the
histogram plot?
for example:
>fitdistr(na.exclude(mydata),"normal")
m
On Sat, 2010-01-02 at 23:20 -0800, Saji Ren wrote:
> Hi, R users:
>
> I want to fit my data into a normal distribution by using the command
> "fitdistr" in "MASS".
> I changed my data class from "ts" to "numeric" by
>
> >class(mydata)="numeric"
>
> but after using "fitdistr", I got the result be
Please read the footer of this message. ?fitdistr says
x: A numeric vector.
and setting the class does not make it a numeric vector (it is just a
label). And fitdistr early on does
if (missing(x) || length(x) == 0L || mode(x) != "numeric")
stop("'x' must be a non-empty nu
And when I used the command below:
>fitdistr(mydata, "normal", na.rm=TRUE)
the result is still the same.
--
View this message in context:
http://n4.nabble.com/Help-with-function-fitdistr-in-MASS-tp997609p997615.html
Sent from the R help mailing list archive at Nabble.com.
I check my data again, and find that:
1. when the class of "mydata" is ts, I can't compute the sd of it. R returns
'NA'.
2. when I change the class from ts into numeric, R still can't compute the
sd of the data.
Any suggestion?
--
View this message in context:
http://n4.nabble.com/Help-with-fu
Hi, R users:
I want to fit my data into a normal distribution by using the command
"fitdistr" in "MASS".
I changed my data class from "ts" to "numeric" by
>class(mydata)="numeric"
but after using "fitdistr", I got the result below
>fitdistr(mydata,"normal")
meansd
NA NA
(NA)
On Fri, Mar 13, 2009 at 6:28 PM, Lars Bishop wrote:
> Dear All,
>
> I need to write 'n' functions on 'm' variables. The functions should be
> constructed according to the values of an (nxm) matrix of '1/0' values as
> follows. For example,
>
> if row1 is equal to ,say [1 0 ...0 0] then f1 <-
Dear All,
I need to write 'n' functions on 'm' variables. The functions should be
constructed according to the values of an (nxm) matrix of '1/0' values as
follows. For example,
if row1 is equal to ,say [1 0 ...0 0] then f1 <- (1+x1)
if row 2 is equal to, say [1 1 1 0...0 1] then f2
<-(1+x1)
I think you can get the median with:
filter(MATDINAMIC$VELOCIDADFIN[1:1000],c(0, 1, 0))
On Mon, Jun 9, 2008 at 5:08 PM, wilquin Minaya <[EMAIL PROTECTED]>
wrote:
>
> Hi everybody
>
> I need to create a program using the function filter with this vector.
> MATDINAMIC$VELOCIDADFIN[1:1000]
>
Hi everybody
I need to create a program using the function filter with this vector.
MATDINAMIC$VELOCIDADFIN[1:1000]
That´s why I want to identify when use the mean and the median because I
have problems.
I want to know if I am using correct this:
filter(MATDINAMIC$VELOCIDADFIN[
24 matches
Mail list logo