similar to: Variance of the prediction in the linear regression model (Theory and programming)

Displaying 20 results from an estimated 600 matches similar to: "Variance of the prediction in the linear regression model (Theory and programming)"

2010 Jun 22
2
Verify the linear regression model used in R ( fundamental theory)
Hi, folks, As I understand, Least-squares Estimate (second-moment assumption) and the Method of Maximum Likelihood (full distribtuion assumption) are used for linear regression. I do >?lm, but the help file does not tell me the model employed in R. But in the book 'Introductory Statistics with R', it indicates R estimate the parameters using the method of Least-squares. However it
2010 Jun 24
2
count data with a specific range
I would like to prepare the data for barplot. But I only have the data frame now. x1=rnorm(10,mean=2) x2=rnorm(20,mean=-1) x3=rnorm(15,mean=3) data=data.frame(x1,x2,x3) If there a way to put data within a specific range? The expected result is as follows: range x1 x2 x3 -10-0 2 5 1 (# points in this
2010 Jun 21
2
How to predict the mean and variance of the dependent variable after regression
Hi, folks, As seen in the following codes: x1=rlnorm(10) x2=rlnorm(10,mean=2) y=rlnorm(10,mean=10)### Fake dataset linmod=lm(log(y)~log(x1)+log(x2)) After the regression, I would like to know the mean of y. Since log(y) is normal and y is lognormal, I need to know the mean and variance of log(y) first. I tried mean (y) and mean(linmod), but either one is what I want. Any tips? Thanks in
2012 Aug 29
3
Help on calculating spearman rank correlation for a data frame with conditions
Dear all, Suppose my data frame is as follows: id price distance 1 2 4 1 3 5 ... 2 4 8 2 5 9 ... n 3 7 n 8 9 I would like to calculate the rank-order correlation between price and distance for each id. cor(price,distance,method = "spearman") calculate a correlation for all. Then I tried to use apply(data,list='id',cor(price , distance , method =
2010 Jun 18
1
How to calculate the robust standard error of the dependent variable
Hi, folks linmod=y~x+z summary(linmod) The summary of linmod shows the standard error of the coefficients. How can we get the sd of y and the robust standard errors in R? Thanks! [[alternative HTML version deleted]]
2010 Jun 26
1
All a column to a data frame with a specific condition
Hi, folks, Please first look at the codes: plan_a=c('apple','orange','apple','apple','pear','bread') plan_b=c('bread','bread','orange','bread','bread','yogurt') value=1:6 data=data.frame(plan_a,plan_b,value) library(plyr) library(reshape) mm=melt(data, id=c('plan_a','plan_b'))
2010 Sep 02
1
How to generate integers from uniform distribution with fixed mean
Hi, folks, runif (n,min,max) is the typical code for generate R.V from uniform dist. But what if we need to fix the mean as 20, and we want the values to be integers only? Thanks [[alternative HTML version deleted]]
2010 Jun 23
1
How to 'understand' R functions besides reading R codes
Apologize for not being clearer earlier. I would like to ask again. Thank Joris and Markleeds for response. Two examples: 1. Function 'var'. In R, it is the sum of square divided by (n-1) but not by n. (I know this in R class) 2. Function 'lm'. In R, it is the residual sum of square divied by (n-2) not by n, the same as in the least squares estimate. But the assumption following
2010 Jun 25
2
Delete rows in the data frame by limiting values in two columns
Hi, folks, Finally Friday~~ Here comes the question: x=c('germany','poor italy','usa','england','poor italy','japan') y=c('Spain','germany','usa','brazil','england','chile') s=1:6 z=3:8 test=data.frame(x,y,s,z) #Now I only concern the countries ('germany','england','brazil').
2010 Jul 02
2
how to save summary(lm) and anova (lm) in format?
Hi, folks, I would like to copy the output of summary(lm) and anova (lm) in R to my word file. But the output will be a mess if I just copy after I call summary and anova. ##################### x=rnorm(10) y=rnorm(10,mean=3) lm=lm(y~x) summary(lm) Call: lm(formula = y ~ x) Residuals: Min 1Q Median 3Q Max -1.278567 -0.312017 0.001938 0.297578 1.310113
2010 Jun 29
3
How to delete the replicate rows by summing up the numeric columns
Hi, folks, I am sorry that I did not state the problem correctly yesterday. Please let me address the problem by the following codes: first=c('u','b','e','k','j','c','u','f','c','e')
2008 Apr 01
1
set the lower bound of normal distribution to 0 ?
Tom Cohen <tom.cohen78@yahoo.se> skrev: Thanks Prof Brian for your suggestion. I should know that for right-skewed data, one should generate the samples from a lognormal. My problem is that x and y are two instruments that were thought to be measured the same thing but somehow show a wide confidence interval of the difference between the two intruments.This may be true that these
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
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
2003 Mar 26
2
predict (PR#2685)
There is a bug in `predict' whereby the order of variables sometimes gets re-arranged compared to the original fit, and then disaster results. Specifically, the 'variables' and 'predvars' attributes of a 'terms' object get out of synch. This only happens when the terms in the original formula get re-ordered during fitting: test> scrunge.data_ data.frame(
2008 May 06
0
Model Based Bootstrap
Hello. Has anyone any idea how a function would look like of a model based bootstrap, when the underlying time series follows an ARIMA(1,1,1)-process? A pure AR-process is no problem, but what is, if the time series need to be differentiated of order one or above and the additional MA-part? Sample code for a series, which follows a pure AR-process: #Series y of 192 observations, which follows
2006 Jan 31
0
multiple relational tables theory
I''m a little unclear on theory here. I have a number of tables but specifically... clients placements facilities A client may have only 1 placement A placement may have only 1 client but there may be many placements per client. A placement may have only 1 facility A facility may have only 1 placement but there may be many placements per facility I''m wondering if it is
2010 Jan 11
1
Solving graph theory problems with R ? (minimum vertex cover)
I just realized (after many discussion with friends), that I might need to solve a (classical) graph theory problem with R. My specific problem is called: Minimum vertex cover <http://en.wikipedia.org/wiki/Vertex_cover#Definition> for a hypergraph <http://en.wikipedia.org/wiki/Hypergraph> (Please see the links for a formal explanation, also with some pictures) Which is another way of
2010 Jul 09
0
Rx/Tx fine tuning of analogue card to PRI card - Am I right with my theory?
Hi Everyone, I want to fine tune the Rx and Tx gain on an analogue Sangoma card by dialing into another server that is running on Sangoma PRI card (both services on Bell network). [mwatt1004khz] exten => s,1,Answer exten => s,n,PlayTones(1004/1000) exten => s,n,Wait(300) If I match the Rx/Tx numbers on both sides by monitoring "ztmonitor X -vv" am I right with my theory of
2010 Jan 19
1
Sampling theory
Hi there, are there any R-packages for computations required in sampling theury (such as confidence intervals under random, stratified, cluster sampling; I'd be partoculary interested in confidence intervals for the population variance, which is difficult enough to find even in books)? Thanks, Christian *** --- *** Christian Hennig University College London, Department of Statistical