Displaying 20 results from an estimated 400 matches similar to: "result numeric(0) when using variable1[which(variable2="max(variable2)"]"
2012 Jan 11
3
Accomplishing a loop on multiple columns
Hello,
I have a question concerning ?for loops? on multiple columns.
I made 91 columns with results (all made together with a for loop) and I
want to us lm to fit the model.
I want to compare the results of all these calculated columns (91) with one
column with observed values. I use the function lm to fit the model and
calculate r.squared. I manage to do this for each column separately:
For
2012 Jan 18
3
manipulating data of several columns simultaneously
Dear all,
I have a question concerning manipulating data of several columns of a
dataframe at the same time.
I manage to do it for one column (with the use of the specific name for this
column).
In each columns, I have 60 values. But I should reorganize the values
(because I created this as an output before and I want to compare it with an
other dataset). I want that the value on row 2 becomes
2007 Sep 13
5
statistics - hypothesis testing question
I estimate two competing simple regression models, A and B where the LHS
is the same in both cases but the predictor is different (
I handle the intercept issue based on other postings I have seen ). I
estimate the two models on a weekly basis over 24 weeks.
So, I end up with 24 RSquaredAs and 24 RsquaredBs, so essentally 2 time
series of Rsquareds. This doesn't have to be necessarily thought
2012 Jun 05
1
nls: how do you know if the model is significant?
Hi all,
I'm struggling with nls. How do you know if your model is significant? For a
lm, you get a p-value, but you don't get it for a nls. Is there a way to
calculate it?
For a lm I use this:
a<-summary(lm(model ~obs))
f.stat<-a$fstatistic
p.value<-1-pf(f.stat["value"],f.stat["numdf"],f.stat["dendf"])
Is there something similar for a nls?
2005 Feb 08
3
logistic regression
Hi,
I'm using glm function to do logistic regression and now I want to know if it
exists a kind of R-squared with this function in order to check the model.
Thank you.
2012 Feb 13
2
different way for a for loop for several columns?
Hi,
I have a question about repeating something for several columns. I
calculated a lot of values for different objects. The values are normally
calculated step-wise for every day for each object. With this obtained data
frame, I make further calculations. Here I have to calculate some things and
I have to take into account the years because I want a number for each year.
I do these first for one
2012 Jun 04
2
Non-linear curve fitting (nls): starting point and quality of fit
Hi all,
Like a lot of people I noticed that I get different results when I use nls
in R compared to the exponential fit in excel. A bit annoying because often
the R^2 is higher in excel but when I'm reading the different topics on this
forum I kind of understand that using R is better than excel?
(I don't really understand how the difference occurs, but I understand that
there is a
2011 Apr 15
3
Rsquared for anova
I calculate an anova test in the following way:
expdata<-read.table("/home/dorien/UA/meta-music/optimuse/optimuse1-build-desktop/results/results_processedCP",
header=TRUE)
2004 Nov 20
1
annotation problems (conditional text())
Hello,
I'm trying to annotate my plots nicely and am running into trouble.
This example contains two problems:
a) the 'text()' arguments do not show the conditional behavior I'm
trying to give them. I try to test for the intercept of my regression
and reformat the output accordingly ('+ intercept' in the >= 0 case and
'- sqrt(intercept^2)' in the other case),
2012 Feb 16
1
how to get r-squared for a predefined curve or function with "other" data points
hello mailing list!
i still consider myself an R beginner, so please bear with me if my
questions seems strange.
i'm in the field of biology, and have done consecutive hydraulic
conductivity measurements in three parallels ("Sample"), resulting in three
sets of conductivity values ("PLC" for percent loss of conductivity,
relative to 100%) at multiple pressures
2012 Mar 13
1
size of graphs when using multiple figures by row
Hi all,
I have a basic question concerning graphs in R. I?m using the par()
function and I?m working with multiple figures by row (mfrow) but my the
hight of my figures become compressed. I have 4 rows and 2 columns (because
I want to plot 8 histograms (freq = FALSE ) on it. I know I can adapt my
margins with for example ?oma? and ?mai? but I don?t know how to choose the
size of the figure? I
2013 Mar 02
2
caret pls model statistics
Greetings,
I have been exploring the use of the caret package to conduct some plsda
modeling. Previously, I have come across methods that result in a R2 and
Q2 for the model. Using the 'iris' data set, I wanted to see if I could
accomplish this with the caret package. I use the following code:
library(caret)
data(iris)
#needed to convert to numeric in order to do regression
#I
2012 Feb 20
1
apply with as function ifelse with 2 logical conditions
Hi all,
I have a question concerning using several conditions in an ifelse function
used as the function in apply.
I want to create a new value with the function ifelse ? object which can be
coerced to logical mode ?test[n,] >1 & test[n-1,]==0?
With n I mean the row. I don?t know how I could do this without a loop. I
want to avoid the usage of loops and was thinking about apply. This
2007 Aug 28
1
FW: How to fit an linear model withou intercept
Hi Mark,
I don't know wether you recived a sufficient reply or not, so here are
my comments to your problem.
Supressing the constant term in a regression model will probably lead to
a violation of the classical assumptions for this model.
From the OLS normal equations (in matrix notation)
(1) (X'X)b=X'y
and the definition of the OLS residuals
(2) e = y-Xb
you get - by
2012 Feb 15
2
function similar to ddply? + calculations based on previous row
Hi all,
I was wondering if there is a function kind of similar that splits a
dataframe, applies a function to each row and returns in a data frame. I
know ddply but this one isn?t useful in this situation.
I have a dataframe with values for each day (rows) for different objects
(columns). I have values for several years. Now, I want to do calculations
on only the data of that year. With the
2007 Dec 11
1
postResample R² and lm() R²
Hello,
I'm with a conceptual doubt regarding Rsquared of both lm() and
postResample(library caret).
I've got a multiple regression linear model (lets say mlr) with anR² value
of 67.52%.
Then I use this model pro make predictions with predict() function using the
same data as input , that is, use the generated model to predict the value
associated with data that I used as input.
Next, if
2008 Jul 16
1
R-source code of a function
Hi,
I know that if i want to see the SPLUS or R-source code of a function,i should give the command
without the brackets.For example:
rsquared.lmRobMM
function(x)
{
str0 <- "Initial S-estimate"
str1 <- "Final M-estimate"
if(x$est == "final") {
z <- x$r.squared
attr(z, "info") <- str1
}
if(x$est == "initial") {
z <-
2002 May 09
4
Rsquared in summary(lm)
Hello,
I'm doing some linear regression:
>lm<-lm(osas~alp,data)
>summary(lm)
However, the Rsquared in the output of summary() is not the same as the
"standard" Rsquared calculated by spreadsheets, and outlined in
statistical guidebooks, being SSR/SSTO. The output says "multiple
Rsquared", but it is no multiple regression...
What's the difference?
Thanks,
2006 Jul 09
1
KS Test Warning Message
All,
Happy World Cup and Wimbledon. This morning finds me with the first
of my many daily questions.
I am running a ks.test on residuals obtained from a regression model.
I use this code:
> ks.test(Year5.lm$residuals,pnorm)
and obtain this output
One-sample Kolmogorov-Smirnov test
data: Year5.lm$residuals
D = 0.7196, p-value < 2.2e-16
alternative hypothesis: two.sided
Warning
2010 Apr 29
1
How to estimate the residual SD for each sample separately in mixed-effects model?
Dear R-helpers,
I am developing a Mixed-Effects model for a study of immunoassays using
'lme4' library. The study design is as follows: 10 samples were run
using 7 different immunoassays, 3 times each, in duplicates. Data
attached. I have developed the following model:
c.lme <- lmer(Result~SPL + (SPL|Assay/Run) -1, data=data)
This model has excellent predictions - the Rsquared of