Displaying 6 results from an estimated 6 matches for "mean_y".
Did you mean:
mean_
2010 Jul 21
2
Variance of the prediction in the linear regression model (Theory and programming)
...the newdata is x, why it does not
work though?
2. Because the prediction is conducted for log(y). I need to get the
expected value of y, which is LN distribution, for the new data sets. I need
to know the expectation of log(y) and variance of log(y).
#####
mean=mean(prediction)
sd=sd(prediction)
mean_y=exp(mean+0.5*sd^2) ### formula from Normal to LN
######
Is sd(prediction) the correct why to calculate the sigma of the prediction?
Or should I just use the value of Residual standard error from summary(lin)?
Answer to either question will be appreciated!
Thanks
Yi
[[alternative HTML version...
2008 Apr 01
1
set the lower bound of normal distribution to 0 ?
...ated distribution since I want the samples
to take values from 0 to the max(x) respectively max(y).
I am unsure how to specify the means and standard deviations
in 'urlnorm'. Based on x- and y-values I have standard deviations
sd_x=0.3372137, sd_y=0.5120841 and the means mean_x=0.3126667
mean_y=0.4223137 which are not on log scale as required in urlnorm.
To covert sd_x, sd_y and mean_x, mean_y on a log-scale I did
sd_logx=sqrt(log(1.3372137))=0.54, sd_logy=sqrt(log(1.5120841))=0.64,
mean_logx=-(0.54^2)/2 and mean_logy=-(0.64^2)/2. Can anyone tell if these
are correctly calculated? Are...
2008 May 06
0
Model Based Bootstrap
...tional MA-part?
Sample code for a series, which follows a pure AR-process:
#Series y of 192 observations, which follows an AR(1)-process
#Fit of an AR(1)-Model to y
ar.coef <- ar(y)$ar
ar.resid <- ar(y)$resid
#Sampling for mean
y_sample <- numeric(192)
y_sample[1] <- y[1]
mean_y <- numeric(10000)
for (i in 1:10000)
{
for (j in 1:191)
{
idx <- sample(2:192,1,replace=TRUE)
y_sample[j+1] <- y_sample[j]*ar.coef+ar.resid[idx]
}
mean_y[i] <- mean(y_sample)
}
What would the function look like if y follows an ARIMA(1,1,1)-process for e...
2011 Jul 11
2
best way to aggregate / rearrange data.frame with different data types
Hi,
I have a data.frame that looks like this:
Subject <- c(rep(1,4), rep(2,4), rep(3,4))
y <- rnorm(12, 3, 2)
gender <- c(rep("w",4), rep("m",4), rep("w",4))
comment <- c(rep("comment A",4), rep("comment B",4), rep("comment C",4))
data <- data.frame(Subject,y,gender,comment)
data
Subject y gender
2010 May 24
1
Fixed Effects Estimations (in Panel Data)
dear readers---I struggled with how to do nice fixed-effects
regressions in large economic samples for a while. Eventually, I
realized that nlme is not really what I needed (too complex), and all
I really wanted is the plm package. so, I thought I would share a
quick example.
################ sample code to show fixed-effects models? in R
# create a sample panel data set with firms and years
2013 Feb 01
2
Nested loop and output help
Hello Everyone,
My name is Thomas and I have been using R for one week. I recently found
your site and have been able to search the archives of posts. This has
given me some great information that has allowed me to craft an initial
design to an inquiry I would like to make into the breakdown of McNemar's
test. I have read an intro to R manual and the posting guides and hope I am
not violating