Displaying 15 results from an estimated 15 matches for "year3".
Did you mean:
year
2011 Jul 27
2
for loop help
...years ###
ppt2 <- matrix(ppt[,which(stnid == '140365')],ncol=1)
year2 <- year[which(stnid == '140365')]
year2 <- year2[which(duplicated(year2) == FALSE)]
month2 <- month[which(stnid == '140365')]
ppt3 <- matrix(ppt[,which(stnid == '140405')],ncol=1)
year3 <- year[which(stnid == '140405')]
year3 <- year3[which(duplicated(year3) == FALSE)]
month3 <- month[which(stnid == '140405')]
2012 Feb 19
2
barplot with more than 1 variable
...ree bars for each year for each country. I
am attaching the chart I made in Stata, but I am not sure you'll
manage to see it!
I did the following:
#here I create the data-set TUSE2. The vectors mw, st and all are the
three variables I'd like to plot in each of the two years of the
variable year3 for each country.
country <- c("United States","United
States","Italy","Italy","Germany","Germany","Netherlands","Netherlands")
year3 <- c(1, 2, 1, 2, 1, 2,1 , 2)
mw <- c( 245.8, 255.9, 248.5, 207.4,263.9, 19...
2006 Aug 24
1
Using a 'for' loop : there should be a better way in R
...rnings in the
Intro to R, etc, about using loops I wondered if
anyone could suggest something a bit simpler or more
efficent?
Example:
cat1 <- c( 1,1,6,1,1,5)
cat2 <- c( 1,2,3,4,5,6)
cat3 <- c( 5,4,6,7,8,8)
cat4 <- c( 1,2,1,2,1,2)
years <- c( 'year1', 'year2', 'year3', 'year3',
'year1', 'year1')
id <- c('a','a','b','c','c','a')
df1 <- data.frame(id,years,cat1,cat2, cat3, cat4)
nn <- levels(df1$id) # levels for outer loop
hh <- levels(df1$years) # levels for inter loop...
2011 Feb 18
2
R script HELP!
...at
data..perhaps it is the ID_min or ID_max that is wrong? I don't know, any
help would be greatly appreciated :(
# OPTIONS - CHANGE THESE VARIABLES IF NEEDED\par
######################################################################\par
\par
icesatfile <-
'C:/Users/Whiz/My_Documents/Year3/GY3072/ICESat_GLAS/IDLreadGLASWF/out_wf_GLA01_09030918_r5947_031_L2E.dat'\par
\par
plotdir <- 'C:/Users/Whiz/My_Documents/Year3/GY3072/ICESat_GLAS/PLOT'\par
\par
\par
\par
ID_min <- 976834501 290018099.3145 1000 #231741042 # specify range of
waveforms to be plotted, -1 means all\...
2013 Apr 03
1
linear model coefficients by year and industry, fitted values, residuals, panel data
...2003,5)
industry2<-rep(30,15)
X<-rnorm(15)
Y<-rnorm(15)
Z<-rnorm(15)
data2<-data.frame(firm2,year2,industry2,X,Y,Z)
data2
colnames(data2)<-c("firm","year","industry","X","Y","Z")
firm3<-sort(rep(16:20,4),decreasing=F)
year3<-rep(2001:2004,5)
industry3<-rep(40,20)
X<-rnorm(20)
Y<-rnorm(20)
Z<-rnorm(20)
data3<-data.frame(firm3,year3,industry3,X,Y,Z)
data3
colnames(data3)<-c("firm","year","industry","X","Y","Z")
final1<-rbind(data1,dat...
2010 Jan 30
2
drawing a line that shifts from solid to broken
...ta from three time points. I'd like to draw a
solid line from point 1 to point 2, and then a dashed line from point 2 to
point 3. It works if I do it in two steps:
> first.vector <- c(mean(year1$variable1), mean(year2$variable1))
> second.vector <- c(NA, mean(year2$variable1), mean(year3$variable1))
> plot(first.vector, type="b", xlim=c(1,3))
> lines(second.vector, type="b", lty=2)
It's clunky, though, and I have a bunch of these to do. Can I streamline it?
TIA.
Jamie
[[alternative HTML version deleted]]
2007 Jun 29
1
Assign name to a name
I would like to know how I can assign a name to a name. I have a
dataset that has different years in it. I am writing scripts using R
and I would like to give a month a generic name and then use the generic
name to do different analysis. The reason for the generic name would be
so that I only have to change one thing if I wanted to change the year.
For example.
Year1 = 1999
datayear <-
2010 Aug 20
1
Shifting of Principal amount while calculating Present Value
Dear R Helpers
I have following data -
cash_flow = c(7, 7, 107) # 107 = Principle 100 + interest of 7%
t = c(1,2,3)
and zero rate table as
rating year1 year2 year3
AAA 3.60 4.17 4.73
AA 3.65 4.22
4.78
A 3.72 4.32 4.93
BBB 4.10 4.67 5.25
For each of these ratings I need to calculate the Present Value as (say e.g....
2012 Jun 24
2
Defining multiple variables in a loop
...oyment, size =
(nrow(country2)), replace = T))
unemployment3 <- as.matrix(sample(country3$lagunemployment, size =
(nrow(country3)), replace = T))
country.year1 <- as.matrix(cbind(country1$Country, country1$Year2))
country.year2 <- as.matrix(cbind(country2$Country, country2$Year2))
country.year3 <- as.matrix(cbind(country3$Country, country3$Year2))
country1.2 <- as.data.frame(cbind(country.year1, exp1, tax1, gdp1,
unemployment1))
country2.2 <- as.data.frame(cbind(country.year2, exp2, tax2, gdp2,
unemployment2))
country3.2 <- as.data.frame(cbind(country.year3, exp3, tax3, gdp3,...
2008 Oct 12
0
false convergence (8) after removal of the two-way interaction
...)
(Intercept) -1.513e-01 1.356e+00 -0.1116 0.91112
VAR2 -1.440e-02 6.429e-02 -0.2241 0.82271
VAR3 3.130e-04 1.413e-03 0.2215 0.82469
year1 -2.671e-01 5.719e-01 -0.4670 0.64050
year2 4.888e-01 4.792e-01 1.0199 0.30780
year3 -2.720e+00 1.169e+00 -2.3260 0.02002 *
year4 1.287e+00 4.211e-01 3.0569 0.00224 **
year5 -1.180e-01 4.195e-01 -0.2812 0.77855
year6 7.367e-01 4.249e-01 1.7340 0.08292 .
VAR1 -2.083e-02 4.826e-02 -0.4317 0.66596
VAR4...
2009 Apr 16
0
incorrect handling of NAs by na.action with lmList (package nlme) (PR#13658)
...all the object, I see :
Call:
Model: variable1 ~ treatmentB | year/treatmentA
Data: data
Coefficients:
(Intercept) treatment B
year2/treatmentA0 44.08387 81.11284
year2/treatmentA1 66.61333 155.62163
year3/treatmentA0 60.55125 72.83121
year3/treatmentA1 63.62340 161.92080
Degrees of freedom: 188 total; 176 residual
Residual standard error: 24.09452
There is no data for year 1, but I didn't add variable 3 to my model, so
the estimates should be there...
2013 Jun 07
4
matched samples, dataframe, panel data
...781,32489,2345,5754,8976,3245,2120,345,2341,5678,10900,12900,123,2345)
data2<-data.frame(firm2,year2,industry2,dummy2,dimension2)
data2
colnames(data2)<-c("firm","year","industry","dummy","dimension")
firm3<-sort(rep(16:20,4),decreasing=F)
year3<-rep(2001:2004,5)
industry3<-rep(40,20)
dummy3<-c(0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,0,0,1,0,0)
dimension3<-c(23456,1181,32489,2345,6754,8976,3245,1234,1288,1200,2345,2765,389,23456,2367,3892,6438,24824,
23,2897)
data3<-data.frame(firm3,year3,industry3,dummy3,dimension3)
data3
colnames(da...
2011 Aug 03
1
Need help with xyplot
Consider I have the following data:
AgeRange AgeOfPerson PersonNo FriendsAtYear0 FriendsAtYear1 FriendsAtYear2 FriendsAtYear3 FriendsAtYear4 FriendsAtYear5
10 - 12 11 1 0 1 2 2 3 3
10 - 12 12 2 0 1 2 2 3 3
15 - 18 13 3 1 2 3 4 6 7
15 - 18 14 4 1 3 4 5 7 7
30 - 40 33 5 3 5 5 6 8 9
30 - 40 36 6 4 4 4 4 4 4
I want to plot the number of friends against number of years, as to show how friendships grew over time. Also, I want...
2007 Jul 04
0
how to plot a monthplot from a ts object where all individual years are shown (e.g. as lines) and can be compared with a "average or median " year?
...ing with:
forest <- ts(data, frequency=46, start=c(2000,8), end=c(2006,46))
I tried it as follows but this is not very clear.
year0 <- window(forest, start=2000,end=c(2000,46))
year1 <- window(forest, start=2001,end=c(2001,46))
year2 <- window(forest, start=2002,end=c(2002,46))
year3 <- window(forest, start=2003,end=c(2003,46))
year4 <- window(forest, start=2004,end=c(2004,46))
year5 <- window(forest, start=2005,end=c(2005,46))
year6 <- window(forest, start=2006,end=c(2006,46))
plot(1:46,years[,1], col=2)
lines(1:46,years[,2], col=3)
lines(1:46,years[,3], c...
1999 Nov 25
1
gnls
...n
#asymptote depends on variety?
mu2 <- function(p) (p[1]+p[4]*variety)/(1+exp((p[2]-times)/p[3]))
elliptic(data,model=mu2,preg=c(17,52,7.5,0),varfn=shape,pvar=c(1.8,-2.2),
shfn=T,par=0.9,dist="Student",pell=6.5)
# also on year?
mu3 <- function(p) (p[1]+p[4]*variety+p[5]*year2+p[6]*year3)/
(1+exp((p[2]-times)/p[3]))
elliptic(data,model=mu3,preg=c(14.5,52,7.5,4.5,0,0),varfn=shape,
pvar=c(1.8,-2.2),shfn=T,par=0.9,dist="Student",pell=8)
# etc.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac...