Displaying 20 results from an estimated 51 matches for "twoway".
2008 Mar 07
1
Finding Interaction and main effects contrasts for two-way ANOVA
...s using R. I've found the functions C(), contrasts(),
se.contrasts() and fit.contrasts() in package gmodels. Given the url
for a small dataset and the two-way anova model below, I'd like to
reproduce the results from appended SAS code. Thanks. --Dale.
## the dataset (from Montgomery)
twoway <- read.table("http://dsteele.veryspeedy.net/sta501/twoway.txt",
col.names=c('material', 'temp','voltage'),colClasses=c('factor',
'factor', 'numeric'))
## the model
fit <- aov(voltage ~ material*temp, data=twoway)
/* SAS code */
pr...
2010 May 17
0
plm(..., model="within", effect="twoways") is very slow on unablanaced data (was: Re: Regressions with fixed-effect in R)
Hello Giovanni
I made a minor modification to your function, which now allows to
compute the within R-sq in Twoways Within models (see below).
However I ran into an issue that I have already encountered before:
whenever I try to fit Twoways Within models on my unbalanced data, the
process is strangely slow and I usually terminate it either after
~15min or when my CPU hits 100C. This is similar to what I mentio...
2010 Apr 08
1
plm package twoways effect problem
Hello everyone,
I have a peoblem to create the twoways effect in the plm package.
when i try to create the following
dsn1<-plm(lnQ~lnC+lnL+lnM+lnE+eco+RD,data=newdata,effect="twoways",model="within")
i have this error:
Error in rep.int(c(1, numeric(n)), n - 1L) : negative length vectors
are not allowed
and to be honest i...
2010 Apr 09
0
panel regression with twoways random effects, on unbalanced data?
Dear R users
What would be the best way to approach estimating a panel regression
with twoways random effects, on unbalanced data? Unfortunately, the
"plm" package has no implementation of twoways random effects for
unbalanced data. Currently I'm considering two approaches:
- extend "plm" to cover this type of panel regression. (For the
authors, cc'ed:) Would imp...
2010 Mar 16
2
plm "within" models: is the correct F-statistic reported?
Dear R users
I get different F-statistic results for a "within" model, when using
"time" or "twoways" effects in plm() [1] and when manually specifying
the time control dummies [2].
[1] vignette("plm")
[2] http://cran.r-project.org/doc/contrib/Farnsworth-EconometricsInR.pdf
Two examples below:
library("AER")
data("Grunfeld", package = "AER")
library(&...
2010 Apr 14
1
Sig differences in Loglinear Models for Three-Way Tables
...27261 2 0.08948981
Pearson 4.680124 2 0.09632168
I compared the independence model (Model1), two-way association model (Model
2), and three-way interaction model (Saturated), and found that the two-way
association model was the most parsimonious one:
> ind <- loglm(n~A+T+L)
> twoway <- loglm(n~A:T+A:L+T:L)
> anova(ind,twoway)
LR tests for hierarchical log-linear models
Model 1:
n ~ T + A + L
Model 2:
n ~ A:L + A:T + T:L
Deviance df Delta(Dev) Delta(df) P(> Delta(Dev)
Model 1 1001.430955 7
Model 2 4.827261 2 996.603694 5 0.00000...
2018 May 08
0
plm(...,"within","twoways") extremely slow on unbalanced panel
I am using it on a big dataset. The estimation was done in hours. But summary() takes forever. Any suggestion is greatly appreciated!
[[alternative HTML version deleted]]
2010 Aug 03
2
How to extract ICC value from irr package?
...st the
consistency among the tests.
*combatexpdata_p[1:62] is the first text results and combatexpdata_p[63:124]
* is the second one and *combatexpdata_p[125:186]* is the third.
Here is the result:
result<-icc(cbind(combatexpdata_p[1:62],combatexpdata_p[63:124],combatexpdata_p[125:186]),
"twoway")
result
Single Score Intraclass Correlation
Model: twoway
Type : consistency
Subjects = 62
Raters = 3
ICC(C,1) = -0.0664
F-Test, H0: r0 = 0 ; H1: r0 > 0
F(61,122) = 0.813 , p = 0.814
95%-Confidence Interval for ICC Population Values:
-0.184 < ICC < 0.086
I can get...
2018 Jan 26
1
plm empty model error
Hi,
I am trying to estimate a two-way model with both individual and time fixed
effects. I am using plm with "twoways" specification.
plm(as.integer(yvar) ~ xvar, index = c("id", "time"), model="within",
data=dataset, effect = "twoways")
But I get keep getting the following message and I don't know what to do
about it, because I don't think anything is wrong...
2008 Apr 19
3
R question for Stata users
Hi...
In Stata, there is the ability to display scatter plots with data
points at the same (x,y)
location, using the 'jitter' command of the twoway scatter stata
command.
Anyone know of a way that I can do the equivalent thing in R?
For non-Stata readers, if jitter is enabled in stata, and n-points
would be at
the same (x,y) location, the points are offset a bit (according to
the jitter parameter)
and you see all the points, though sli...
2009 Aug 21
1
Panel Data Analysis (PLM) - Fixed Effects - "cannot allocate vector of length"
Hello to all on the list,
I'm trying to estimate a fixed effects model from a large (unbalanced) panel
data set.
I have no problems when using only an individual effect or only a time
effect, but I get an error message when I try for a "twoways" effect. Here
is some of the code:
paneldata27 is the entire panel data set:
> dim(paneldata27)
[1] 1178831 8
> paneldata27<-plm.data(paneldata27,index=c("Account","Day.of.Sample"))
> nlevels(paneldata27$Account)
[1] 1573
> nlevels(paneldata27$Day.of...
2011 Apr 03
2
power of 2 way ANOVA with interaction
I've been searching for an answer to this for a while but no joy. I have a simple 2-way ANOVA with an interaction. I'd like to determine the power of this test for each factor (factor A, factor B, and the A*B interaction). How can I do this in R? I used to do this with "proc Glmpower" in SAS, but I can find no analogue in R.
[[alternative HTML version deleted]]
2013 Jan 11
0
Manual two-way demeaning of unbalanced panel data (Wansbeek/Kapteyn transformation)
...y_t<-pmodel.response(plm(formula=inv~value,data=Grunfeld,index=c("firm","year"),model="within",effect="time"))
dem_y_it<-pmodel.response(plm(formula=inv~value,data=Grunfeld,index=c("firm","year"),model="within",effect="twoways"))
dem_X_it<-model.matrix(plm(formula=inv~value,data=Grunfeld,index=c("firm","year"),model="within",effect="twoways"))
sum(y_i!=dem_y_i)
#y_i[1:10]
#dem_y_i[1:10]
sum(y_t!=dem_y_t)
#y_t[1:10]
#dem_y_t[1:10]
sum(y_it!=dem_y_it)
#y_it[1:10]
#dem_y_i...
2009 Mar 03
4
scatter plot question
Hi R Users,
I have a dataframe like this:
id x rho
A 1 0.1
B 20 0.5
C 2 0.9
...
I want to do a scatter plot of "x" versus "rho" but for each point on the
scatter plot I want the corresponding entry for "id" instead of points. In
STATA I can do so by
twoway (scatter x rho, mlabel(id))
How can I do the same in R? I am sure there is some simple way to do this.
Dipankar
[[alternative HTML version deleted]]
2007 Apr 09
1
How to solve differential and integral equation using R?
Hello,
I want to know if there are some functions or packages to solve differential
and integral equation using R.
Thanks.
Shao chunxuan.
[[alternative HTML version deleted]]
2007 Apr 10
1
median polishing
Hi,
In SPlus there is a function called "twoway" for median polishing gridded
data. Is there an equivalent function in R? I have been searching for it
in R help without much success. Your help is much appreciated.
Cheers
Sorn
[[alternative HTML version deleted]]
2013 Mar 05
0
Agreement and Consistency of 2D data
....net/~myvideoc/R20130305/pet_mtx.csv'))
# ICC
# note: modalities are inverse
# thus in modality1 "0" denotes a normal segment and "100" a complete
infarction of the segment
# and vice versa in modality2
library(irr)
print(icc(cbind(100 - c(pet_mtx), c(lge_mtx)), model="twoway", type="c"))
print(icc(cbind(100 - c(pet_mtx), c(lge_mtx)), model="twoway", type="a"))
If the matrices are mapped to polar plots (also called bullseye plots) one
can visually assess their agreement.
Each matrix row defines one circle starting at 0° with columns...
2018 Jan 27
0
plm empty model error (data is linked)
Hi,
I am trying to estimate a two-way model with both individual and time fixed
effects. I am using plm with "twoways" specification.
plm(as.integer(yvar) ~ xvar, index = c("id", "time"), model="within",
data=dataset, effect = "twoways")
But I get keep getting the following message and I don't know what to do
about it, because I don't think anything is wrong...
2011 Oct 06
1
Coefficients for lagged plm model variables not calculated
...n
producing a <summary(model.object).
The code I am using is:
> b<-plm.data(b,index=c("E","M"))
> b.fetw<-plm(B~lag(B,k=1)+Ma+lag(Ma,k=1)+Pa+lag(Pa,k=1)+Ya+lag(Ya,k=1)+F+lag(F,k=1)+CS+R+lag(R,k=1)+G+I,
> data=b, model="within", effect="twoways")
> summary(b.fetw)
Twoways effects Within Model
Call:
plm(formula = B ~ lag(B, k = 1) + Ma + lag(Ma, k = 1) + Pa +
lag(Pa, k = 1) + Ya + lag(Ya, k = 1) + F + lag(F, k = 1) +
CS + R + lag(R, k = 1) + G + I, data = b, effect = "twoways",
model = "within"...
1997 Aug 25
0
R-alpha: `missing' BB functions
...order cutree cycle date
debugger dget discr faces interp l1fit labclust lag loglin
monthplot mstree mulbar napsack odometer persp plclust plotfit
rep.int restore rreg sabl sablplot set.seed smooth sort.list
Stable stars starsymb storage subtree symbols tempfile tslines
tsmatrix tsplot tspoints twoway unlink usa xor
In some detail:
aggregate cycle lag smooth tslines tsmatrix tsplot tspoints:
Obviously useful for time series. Andreas has a quick version
of lag() ...
allocated storage:
Something to display the current memory consumption (other than
as a byproduct of calling gc() would be n...