similar to: C to R

Displaying 20 results from an estimated 4000 matches similar to: "C to R"

2007 Apr 25
3
aggregate similar to SPSS
Hi, Does anyone know if: with R can you take a set of numbers and aggregate them like you can in SPSS? For example, could you calculate the percentage of people who smoke based on a dataset like the following: smoke = 1 non-smoke = 2 variable 1 1 1 2 2 1 1 1 2 2 2 2 2 2 When aggregated, SPSS can tell you what percentage of persons are smokers based on the frequency of 1's and 2's. Can
2008 Jan 14
1
[Off Topic] searching for a quote
Dear community, I'm trying to track down a quote, but can't recall the source or the exact structure - not very helpful, I know - something along the lines that: 80% of [applied] statistics is linear regression ... ? Does this ring a bell for anyone? Thanks, Andrew -- Andrew Robinson Department of Mathematics and Statistics Tel: +61-3-8344-9763 University of
2007 Mar 08
2
augPred in lmer
I read the posts about augPred with lme, but does anyone know if there is a correlate for augPred for lmer? Specifically, I want to be able to use it to plot projections for all groups in an lmer class object using plot(augPred(lmer.object)). Thanks, Kyle *************************************** J. Kyle Roberts, Ph.D. Baylor College of Medicine Center for Educational Outreach One Baylor Plaza,
2007 Mar 16
3
ARIMA standard error
Hi, Can anyone explain how the standard error in arima() is calculated? Also, how can I extract it from the Arima object? I don't see it in there. > x <- rnorm(1000) > a <- arima(x, order = c(4, 0, 0)) > a Call: arima(x = x, order = c(4, 0, 0)) Coefficients: ar1 ar2 ar3 ar4 intercept -0.0451 0.0448 0.0139 -0.0688 0.0010 s.e.
2007 Mar 24
1
p values in lme4 package
Dear R-users, I was wondering if anybody knows if it's possible to obtain a p value for the full model of a GLMM with the lme4 package. I was told that I should check whether the full model including all the predictor variables is significant before doing stepwise regression or further analysis, but I can't figure out how to do this. I also wanted to know if there's a way of
2006 Nov 09
1
Variance Functions in lme
Using the weight argument with a variance function in lme (nlme), you can allow for heteroscedasticity of the within-group error. Is there a way to do this for the other variance components? For example, suppose you had subjects, days nested within subjects, and visits nested within days within subjects (a fully nested two-way design) and you had, say men and women subjects. Could you allow for
2006 Nov 09
1
optimize function with integral form ?
Hi all, Does anybody have the experience of using optim to estimate variables with integral forms? here the code: trun.mean<- function(x) # t is the threshold { mu=x[1]; sigma=x[2]; t=x[3]; f <- function(x) (1/(sigma*sqrt(2*pi)))*exp(-(x-mu)^2/(2*sigma^2)); pdf.fun <- function(x) x*f(x); integrate(f,thre,upper=Inf)$value/integrate(pdf.fun,thre,upper=Inf)$value ; } when I
2006 Nov 10
1
About using the boot function
Dear All, I tried to use the boot function, provided in the boot package, in such a simple task as to create a bootstrap distribution of the mean of a vector x. I wrote: b <- boot(x, mean, R=200) Well, it doesn't work. I suspect it has something to do with what is called "second argument" of the "statistic" in the help page of boot. What is the second argument of
2006 Nov 14
1
Using lrm
Hi, I have to build a logistic regression model on a data set that I have. I have three input variables (x1, x2, x3) and one output variable (y). The syntax of lrm function looks like this lrm(formula, data, subset, na.action=na.delete, method="lrm.fit", model=FALSE, x=FALSE, y=FALSE, linear.predictors=TRUE, se.fit=FALSE, penalty=0, penalty.matrix, tol=1e-7,
2006 Nov 14
2
gam() question
Hi everyone, I am fitting a bivariate smoothing model by using gam. But I got an error message like this: "Error in eigen(hess1, symmetric = TRUE) : 0 x 0 matrix" If anyone know how to figure it out, pleaselet me know. Thanks very much. [[alternative HTML version deleted]]
2006 Nov 15
1
can I get standard error from predict.gam()?
Hi everybody, I am using predict.gam() now. I but it seems there is no such option to get standard errors of the predicted values. I tried to set se=T or se.fit=T but no use. If you know anything about that please let me know. Thanks very much. Kevin. [[alternative HTML version deleted]]
2007 Jan 29
1
[Fwd: Need to fit a regression line using orthogonal residuals]
[Originally sent this to r-help at lists.R-projects.org, but in case that's the wrong list I'm re-posting. Apologies if this becomes a re-post] -------------- next part -------------- An embedded message was scrubbed... From: Jonathon Kopecky <jkopecky at umich.edu> Subject: Need to fit a regression line using orthogonal residuals Date: Mon, 29 Jan 2007 14:52:24 -0500 Size: 1138
2007 Feb 22
1
investigating interactions with mixed models
I'm investigating a number of dependent variables using mixed models, e.g. data.lmer45 = lmer(ampStopB ~ (type + stress + MorD)^3 + (1|speaker) + (1|word), data=data) The p-values for some of the 2-way and 3-way interactions are significant at a 0.05 level and I have been trying to find out how to understand the exact nature of the interactions. Does anyone know if it is possible to run
2007 Feb 22
1
problem with weights on lmer function
Hi, I try to make a model using lmer, but the weigths is not accept. m1<-lmer(ocup/total~tempo+(tempo|estacao),family=binomial,weights=total) Erro em lmer(ocup/total ~ tempo + (tempo | estacao), family = binomial, : object `weights' of incorrect type I dont understand why this error, with glm this work. the total object is a vector. Any idea? Thanks Ronaldo -- God is subtle, but
2007 Apr 09
1
testing differences between slope differences with lme
hello i have a mixed effect model which gives slope and intercept terms for 6 groups (diagnosis (3 levels) by risk group(2 levels)). the fixed part of the model is -- brain volume ~ Diagnosis + Risk Group + (Risk Group * age : Diagnosis) - 1 thus allowing risk group age/slope terms to vary within diagnosis and omitting a nonsignificant diagnosis by risk group intercept (age was centered)
2007 Dec 14
1
way to check if the evaluation of an expression returns an error?
Is there a recommended or "good" way to check if the evaluation of an expression returns an error? e.g. var(NA) I wish var(NA) to return NA or "err", or some other value, even a text-string, but not an error message. I am using a loop to load many samples of data and to perform analysis on each sample. On occasion, the function I execute returns an
2006 Dec 05
5
if(){} else{}
Dear R-community, my data set looks like 'mat' below. Plant<-c(NA,1,1,1,NA,NA,NA,NA,NA,1); Value1<-rnorm(1:10); Value2<-rnorm(1:10); mat<-cbind(Plant,Value1,Value2); I receive data from two different sites. One site is identified by an interger number, the other site has no data in column Plant=NA. My pb: I'm trying to assign labels "A" or "B" to
2007 Mar 07
2
Calculating confidence limits on acf graphs
Hello, I was wondering if anybody could help me with this? I have plotted an acf function for a time series and am very happy with it. Now I am interested in calculating for myself the two values for the confidence intervals that are plotted on the graph of the acf. The confidence intervals do not appear to be returned from the acf function (is this true?). So far I haven't managed to
2006 Dec 07
2
groupedData Error Using outer=TRUE
I'm using groupedData from nlme. I set up a groupedData data.frame with outer=~group1. When I try to plot with outer=TRUE, I get "subscript out of bounds." This happens most of the time. When it works, I get spaghetti-type plots for comparing groups. But I don't understand why it doesn't usually work. > longa.mod.1.gd <- groupedData(mod1.logit~time|
2006 Nov 17
2
Numbers with correct significant digits
This, for example: v <- c(9.6996, 99.99) formatC(v, digits=3, format="g") shows: " 9.7" " 100" This is scientifically incorrect for the first number in the sense that I like to show all 3 significant digits, including trailing zero's. Is there a way that the first number would show as " 9.70"? By the way, can't use format() since it applies