Displaying 20 results from an estimated 100 matches similar to: "Linear mixed model using R"
2012 Aug 17
3
Apply a function according to factor levels.
Dear all,
I have a question on applying a function to the data according to factor
levels.
For example, for the data below, what is the best way to apply a function
to
"values" according to different levels of "samples" (1,2,3,4,5)?
values ind sample
1 0.03325 1 1
2 0.03305 1 1
3 0.03185 1 1
4 0.03515 1 1
5 0.03375 1 1
6 0.01180
2007 Aug 16
0
Linear models and a simple time series
Working on modeling a wild animal population. Two data vectors: the herd
count from year to year (estimated by a
sampling procedure), and the number of animals killed by hunters. Task is
to find the natural growth rate of the herd
(A simplification, but preserves the essentials.)
My question is whether the R procedure lm() is an appropriate tool to
estimate the growth rate.
year
2012 Dec 08
4
read.table()
Hi List,
I have spent more than 30 minutes, but failed to read in this file using the read.table() function. I could not figure out how to fix the following error.
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 1 did not have 6 elements
Any help would be be appreciated.
Thanks,
Pradip Muhuri
####### below is the reproducible example
xd1 <-
2009 Jul 09
2
plm Issues
Hi List
I'm having difficulty understanding how plm should work with dynamic
formulas. See the commands and output below on a standard data set. Notice
that the first summary(plm(...)) call returns the same result as the second
(it shouldn't if it actually uses the lagged variable requested). The third
call results in error (trying to use diff'ed variable in regression)
Other info:
2005 Jul 08
1
help with ARIMA and predict
I'm trying to do the following out of sample
regression with autoregressive terms and additional x
variables:
y(t+1)=const+B(L)*y(t)+C(1)*x_1(t)...+C(K)*x_K(t)
where:
B(L) = lag polynom. for AR terms
C(1..K) = are the coeffs. on K exogenous variables
that have only 1 lag
Question 1:
-----------
Suppose I use arima to fit the model:
2009 Jul 21
1
package quantreg behaviour in weights in function rq,
Dear all,
I am having v.4.36 of Quantreg package and I noticed strange behaviour when
weights were added. Could anyone please explain me what if the results are
really strange or the behavioiur is normal. As an example I am using dataset
Engel from the package and my own weights.
x<-engel[1:50,1]
y<-engel[1:50,2]
w<-c(0.00123, 0.00050, 0.00126, 0.00183, 0.00036, 0.00100,
0.00122,
2010 Aug 27
2
Nestad ANOVA with random Factors
Hi,
I need a help. I am new in R and I need to run a nested anova with fixed and
random factors (Mixed Model). I have a design with three factors: Day, Area
and Plot and the dependent variable is density. The factors Day and Area are
fixed while Plot is random, factor Area is nested in factor Day, and factor
Plot is nested in Area.
I can do it using aov by:
mod1<-aov(density~ day +
2005 Nov 08
1
Interpretation of output from glm
I am fitting a logistic model to binary data. The response variable is a
factor (0 or 1) and all predictors are continuous variables. The main
predictor is LT (I expect a logistic relation between LT and the
probability of being mature) and the other are variables I expect to modify
this relation.
I want to test if all predictors contribute significantly for the fit or not
I fit the full
2012 Oct 08
1
arima.sim
Hi,
I have been using arima.sim from the stats package recently, and I'm
wondering why I get different results when using what seem to be the
same parameters. For example, I've given examples of three different
ways to run arima.sim with what I believe are the same parameters.
It's my understanding from the R documentation that rnorm is the
default function for rand.gen if not
2011 Jul 11
1
Named numeric vectors with the same value but different names return different results when used as thresholds for calculating true positives
Dear List,
I have encountered an odd problem that I cannot understand. It stems
from the calculation of true and false positives based on two input
vectors x and y based on different thresholds of x, extracted using
the quantile function. I am in certain cases getting different values
of true positives for the same threshold value when the threshold was
found under different quantiles (e.g. the
2004 Jul 20
5
Precision in R
Greetings.
I'm trying to recreate in R some regression models I've done in SAS,
but I'm not getting the same results. My advisor suspects this may be
due to differences in precision between R and SAS. Does anyone know
where I can find specifications for R's type double? (It doesn't seem
to be in the R Language Definition.) Thanks in advance for any help
anyone can
2011 Apr 05
6
simple save question
Hi,
When I run the survfit function, I want to get the restricted mean
value and the standard error also. I found out using the "print"
function to do so, as shown below,
print(km.fit,print.rmean=TRUE)
Call: survfit(formula = Surv(diff, status) ~ 1, type = "kaplan-meier")
records n.max n.start events *rmean *se(rmean) median
200.000
2010 Sep 02
1
How using the weights argument in nls2?
Good morning gentlemen!
How using a weighted model in nls2? Values with the nls are logical since
values with nls2 are not. I believe that this discrepancy is due to I did
not include the weights argument in nls2.
Here's an example:
MOISTURE <- c(28.41640, 28.47340, 29.05821, 28.52201, 30.92055,
31.07901, 31.35840, 31.69617, 32.07168, 31.87296, 31.35525, 32.66118,
33.23385,
2010 Aug 18
1
reading lmer table
Dear all,
I'm quite new in R and especially with linear mixed effects models and
I'm not completely sure to read the lmer table in the right way.
for example:
head(march.f)
fam subjID Cond Code reg total first
second log.total log.second cat
3 f 30 an fDan1 3 1.2304688 0.6679688 0.56250000
0.20739519 0.44628710 f
2003 Jul 16
1
The two chisq.test p values differ when the contingency table is transposed! (PR#3486)
Full_Name: Tao Shi
Version: 1.7.0
OS: Windows XP Professional
Submission from: (NULL) (149.142.163.65)
> x
[,1] [,2]
[1,] 149 151
[2,] 1 8
> c2x<-chisq.test(x, simulate.p.value=T, B=100000)$p.value
> for(i in (1:20)){c2x<-c(c2x,chisq.test(x,
simulate.p.value=T,B=100000)$p.value)}
> c2tx<-chisq.test(t(x), simulate.p.value=T, B=100000)$p.value
> for(i in
2009 Jul 09
0
Apply weights to the Efron Approximation
Dear all,
I want to apply weights to my sample data set and I am struggling with the
Efron Approximation with weights.
I have got one sample data shown as below:
customer week arrest fin age race weight 1 weight 2 weight 3
1 20 1 1 27 1 2 15 2
2 17 1 0 18 1 2 19 1
3 25 1 1 19 0 2 20 1
4 52 0 1 23 1 2 5 1
5 52 0 0 19 0 2 11 1
6 25 1 0 19 0 2 26 1
I applied four different weighted Efron
2010 Mar 24
0
Predict from glm
Dear list members,
I fitted a glm model (See output below). My outcome is death, and weight
(continuous), ClutchSize (3-level factor), EggVolume (continuous), Sex
(obviously 2-level factor), and SiblingCompetence (2-level factor) are my
covariates.
I'd like to obtain the odds of death for a range of Weights, EggVolumes, and
different combinations of ClutchSize. I've tried using the
2012 Jun 30
2
Significance of interaction depends on factor reference level - lmer/AIC model averaging
Dear R users,
I am using lmer combined with AIC model selection and averaging (in the
MuMIn package) to try and assess how isotope values (which indicate diet)
vary within a population of animals.
I have multiple measures from individuals (variable 'Tattoo') and multiple
individuals within social groups within 4 locations (A, B, C ,D) crucially I
am interested if there are
2006 Mar 31
1
Oracle 8 to 9 strange performance issue
Hello,
Got Ruby 1.8.2, RAILS 1.0, Windows2kx and Ruby-OCI8.mswin (1.1.3)
I try a migration test drive for one legacy DB from an original Ora
win32 8.1.7 server to a better hardware running Win32 Oracle 9.2.
The two DB have 99,999% identical datas.
My rails app run on a independant serveur (W2003) using an Oracle
Client 8.1.7. I''ve the same results using IIS/FastCgi or script/server
2006 Oct 11
1
extracting rows
Hi,
I have a matrix with few hundred by a few hundred and want to extract rows,
e.g. (0,1,0), or (1.3, 2.4, 4). I made an example:
> A = rep(rep(c(0,1),4),2)
> B = rep(rep(c(0,1),each=4),2)
> C = rep(rep(rep(c(0,1),2),each=2),2)
> X = data.frame(A,B,C,rnorm(16))
A B C
[1,] 0 0 0 0.72767870
[2,] 1 0 0 -0.09673298
[3,] 0 0 1 0.51192790
[4,] 1 0 1 -1.54350441
[5,] 0 1 0