Displaying 20 results from an estimated 20000 matches similar to: "creating names for regressios using the assign()"
2007 Mar 08
1
how to assign fixed factor in lm
Hi there,
> Value=c(709,679,699,657,594,677,592,538,476,508,505,539)
> Lard=rep(c("Fresh","Rancid"),each=6)
> Gender=rep(c("Male","Male","Male","Female","Female","Female"),2)
> Food=data.frame(Value,Lard,Gender)
> Food
Value Lard Gender
1 709 Fresh Male
2 679 Fresh Male
3 699 Fresh
2006 Dec 18
3
turning expression object to function
Dear all,
I have the following problem.
Given an expression object 'expr' containing a certain set of symbols
(say 'a', 'b', 'c'), I would like to translate the expression object
in an R function of, say, 'a', programmatically. Here an example of
what I mean.
Given:
> expr <- expression(a+b+c)
a call like:
> asFunctionOf(expr, 'a',
2006 Nov 01
1
Compare linear regressios for significant differences of the slopes
Hi
I have (8 measures * 96 groups) = 768 datasets for which I did linear
regressions using lm().
Now I want to compare the slopes for each of the 8 measures in each of
the 96 groups. As I understand , I can not use
> anova(lm1, ..., lm8)
as the lm1 ... lm8 are based on different datasets.
I also read in previous discussions in this list, that I can see if the
slope +- stddev(slope)
2005 Oct 20
5
spliting an integer
Hi there,
From the vector X of integers,
X = c(11999, 122000, 81997)
I would like to make these two vectors:
Z= c(1999, 2000, 1997)
Y =c(1 , 12 , 8)
That is, each entry of vector Z receives the four last digits of each entry of X, and Y receives "the rest".
Any suggestions?
Thanks in advance,
Dimitri
[[alternative HTML version deleted]]
2010 Oct 26
1
lme vs. lmer results
Hello,
and sorry for asking a question without the data - hope it can still
be answered:
I've run two things on the same data:
# Using lme:
mix.lme <- lme(DV ~a+b+c+d+e+f+h+i, random = random = ~ e+f+h+i|
group, data = mydata)
# Using lmer
mix.lmer <- lmer(DV
~a+b+c+d+(1|group)+(e|group)+(f|group)+(h|group)+(i|group), data =
mydata)
lme provided an output (fixed effects and random
2006 Jul 05
1
creating a data frame from a list
Dear all,
I have a list with three (named) numeric vectors:
> lst = list(a=c(A=1,B=8) , b=c(A=2,B=3,C=0), c=c(B=2,D=0) )
> lst
$a
A B
1 8
$b
A B C
2 3 0
$c
B D
2 0
Now, I'd love to use this list to create the following data frame:
> dtf = data.frame(a=c(A=1,B=8,C=NA,D=NA),
+ b=c(A=2,B=3,C=0,D=NA),
+ c=c(A=NA,B=2,C=NA,D=0) )
> dtf
a b
2005 Oct 06
3
Singular matrix
Dear All,
I have written the following programs to find a non-singular (10*10) covariance matrix.
Here is the program:
nitems <- 10
x <- array(rnorm(5*nitems,3,3), c(5,nitems))
sigma <- t(x)%*%x
inverse <- try(solve(sigma), TRUE)
while(inherits(inverse, "try-error"))
{
x <- array(rnorm(5*nitems,3,3), c(5,nitems))
sigma <- t(x)%*%x
inverse <-
2005 Jan 25
2
"disregarded projections" warning when fitting lm model
Hi all,
I'm fitting a linear model (using lm) to some 2500 data points. The
model consists of 4 single terms and two combined terms. I get the
following warning message:
"Extra arguments projections are just disregarded. in: lm.fit(x, y,
offset = offset, singular.ok = singular.ok, ...) "
Can anybody clarify this ? I don't seem to find any pointer to what
this might
2004 Dec 09
1
System is computationally singular?
Hi all,
I was using the Newton-Raphson method to estimate paremeters in the model developed by my supervisor. However, when I interatively computed theta(t+1)=theta(t) - solve(H)*s (where the Hessian matrix and score vector were explicitely derived), I got the error message: Error in solve.default(H) : system is computationally singular: reciprocal condition number = 1.70568e-032. Assume my score
2007 Apr 05
2
creating a data frame from a list
Dear all,
A few months ago, I asked for your help on the following problem:
I have a list with three (named) numeric vectors:
> lst = list(a=c(A=1,B=8) , b=c(A=2,B=3,C=0), c=c(B=2,D=0) )
> lst
$a
A B
1 8
$b
A B C
2 3 0
$c
B D
2 0
Now, I'd love to use this list to create the following data frame:
> dtf = data.frame(a=c(A=1,B=8,C=NA,D=NA),
+
2006 Mar 15
1
variance from correlated observations
Hi all.
A statistical question. I have to estimate the variance of the sum:
X(1) + X(2) + ...+ X(n)
from an observed sample, where X(i) are *correlated* and not necessarly
identically distributed. Someone can suggest a simple strategy
(I hope by exploiting some already present R package) for obtaining such
estimate from an observed vector X[1:n]?
Tnx all,
Antonio, Fabio Di Narzo.
2001 Dec 21
1
pure statistical question
Dear all,
This is a pure statistical question, not necessarly related to R.
I could not find it in literature.
Suppose I'm intersted in a parameter rho, say, equal to:
r=beta1/beta2,
where beta1 and beta2 come from a linear model y=beta0+beta1X1+beta2X2+....
Fitting the model I can get the (biased) estimate of r=b1/b2, where b1 and
b2 are the estimates in the regression model; I can get the
2007 Dec 17
2
[LLVMdev] RFC: GLIBCXX_DEBUG ScheduleDAG Patch
Attached is a patch to fix a GLIBCXX_DEBUG error in ScheduleDAGRRList.
The problem is that calls to CapturePred may reprioritize elements in the
priority queue, violating streak weak ordering requirements.
To fix this, I introduced a reference wrapper for containers to obtain access
to the SUnitVec used by std::priority_queue. When CapturePred runs, it
calls updateNode which does a
2005 Oct 25
2
Inf in regressions
Hi,
Suppose I I wish to run
lm( y ~ x + z + log(w) )
where w assumes non-negative values. A problem arises when w=0, as log(0)
= -Inf, and R doesn't accept that (as it "accepts" NA). Is there a way to
tell R to do with -Inf the same it does with NA, i.e, to ignore it? (
Otherwise I have to do something like
w[w==0] <- NA
which doesn't hurt, but might be a bit
2006 Apr 29
1
help with box-tidwell
Hi everyone
I am using box.tidwell to transform the explanatory variables. However, it appears problematic.
The warning I received as follows.
box.tidwell(Newresponse ~ FAC2_1 + FAC4_1 + FAC5_1 + FAC6_1 + FAC7_1 + KXI + RECODINC)
Warning in log(x) : NaNs produced
Warning in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
extra arguments na.rm are just disregarded.
2013 Apr 16
4
Singular design matrix in rq
Quantreggers:
I'm trying to run rq() on a dataset I posted at:
https://docs.google.com/file/d/0B8Kij67bij_ASUpfcmJ4LTFEUUk/edit?usp=sharing
(it's a 1500kb csv file named "singular.csv") and am getting the following
error:
mydata <- read.csv("singular.csv")
fit_spl <- rq(raw_data[,1] ~ bs(raw_data[,i],df=15),tau=1)
> Error in rq.fit.br(x, y, tau = tau, ...) :
2012 Nov 01
2
subset a defined row plus the aforegoing
Hello,
my data is sorted by start.ens (see below). And now I would like to extract
all rows (so called* defined row*s) with type==Expression - subset (df,
type==Expression) - and the aforegoing type==DNase HS (which is not
necessarly row n-1 - assumung that the defined row is n). I dont know how
to add this to my subset command.
Is that possible?
Thanks Hermann
> df
start.ens fc.trans
2011 Feb 25
1
lm - log(variable) - skip log(0)
I want to do a lm regression, some of the variables are going to be affected
with log, I would like not no take into account the values which imply doing
log(0)
for just one variable I have done the following but it doesn't work:
lmod1.lm <- lm(log(dat$inaltu)~log(dat$indiam),subset=(!(dat$indiam %in%
c(0,1)))
and obtain:
Error en lm.fit(x, y, offset = offset, singular.ok =
2022 Nov 09
1
det(diag(c(NaN, 1))) should be NaN, not 0
Hello,
Currently, determinant(A) calculates the determinant of 'A' by factorizing
A=LU and computing prod(diag(U)) [or the logarithm of the absolute value].
The factorization is done by LAPACK routine DGETRF, which gives a status
code INFO, documented [1] as follows:
*> INFO is INTEGER
*> = 0: successful exit
*> < 0: if INFO = -i, the i-th
2011 Nov 21
1
Problems using log() in a plm() regression.
hey guys
I have a panel data set that i want to perform some regressions on. I am
using the /plm/ package.
I defined a model in the following way:
PWBw.pool <- plm(*PWB* ~ log(*I_EQON*) + log(*RD*) + ... + *PAGRI*,
data = pfem, na.action=na.exclude, model="pooling")
When i run this it gives the following error (the error remains when i use
other model = "" specifications