Displaying 20 results from an estimated 1000 matches similar to: "y_hat"
2009 Sep 17
2
SVM
Hello,
I have 12 sample each sample has got 1000 observation, i.e I have a matrix X with 1000 rows and 12 columns!
m <- svm(t(X))
p <- predict (m)
Can anyone tell me how to use svmtrain() in R!
Many Yhanks,
Samuel
[[alternative HTML version deleted]]
2007 Sep 27
2
plot or boxplot!
Hello,
if we suppose that
times <- c("2006-05-14", "2006-06-12", "2006-06-12", "2006-05-14", "2006-05-14", "2006-06-12")
value <- c(2,3,1,4,3,1)
then with
plot(times, value)
we have two boxplots in one graph for 2006-05-14 and 2006-06-12 respectively! Is it possible to have them in a scatterplot? and
2009 Feb 19
1
matrix computation???
Hello
Can anyone tell me what I am doing wrong below? My Y and y_hat are the same.
A<-scale(stackloss)
n1<- dim(A)[1];n2<-dim(A)[2]
X<-svd(A)
Y<- matrix(A[,"stack.loss"],nrow=n1)
Y
y_hat <-matrix((X$u%*% t(X$u))%*%Y,nrow=n1,byrow=T)
y_hat
[[alternative HTML version deleted]]
2007 Sep 26
2
date
Hello,
I have got the following problem:
> setwd("C:/temp")
> library(xlsReadWrite)
> MyData <- read.xls(file="Mappe1.xls", colNames = TRUE,dateTimeAs = "isodatetime")
> attach(MyData)
> MyData
name value times
1 A1 2 2006-05-12
2 A2 3 2006-05-16
3 A3 1 2006-05-12
4 A4 4 2006-05-12
5 A5 2
2008 Mar 14
2
SAS data
Hello,
I am trying to read the SAS file MyData.sa7bdat in R! This file is saved under D:\data! I therefore wrote
> path <-"D:/SasData"
> sashome <- "C/Progra, Files/SAS Institute/9_1/SAS"
> sascmd <- file.path(sashome, "sas.exe")
> MyData <- read.ssd(path, "MyData", sascmd=sascmd)
The results what I get:
2023 Jan 26
1
Failing to install the rgl package
Hi,
I try to execute the seven lines of code below to plot a graph. But I
am failing as the messages below show. Where am I going wrong?
install.packages("rgl")
library(rgl)
y_hat = X%*%B_hat
open3d(windowRect = c(100,100,900,900),family = "serif")
color = rainbow(length(y_hat))[rank(y_hat)]
plot3d(educ,exper,wage,col = color,type = "s",size = 0.5,xlim =
2010 Jun 23
1
Estimate of variance and prediction for multiple linear regression
Hi, everyone,
Night. I have three questions about multiple linear regression in R.
Q1:
y=rnorm(10,mean=5)
x1=rnorm(10,mean=2)
x2=rnorm(10)
lin=lm(y~x1+x2)
summary(lin)
## In the summary, 'Residual standard error: 1.017 on 7 degrees of freedom',
1.017 is the estimate of the constance variance?
Q2:
beta0=lin$coefficients[1]
beta1=lin$coefficients[2]
beta2=lin$coefficients[3]
2010 Dec 08
1
UniCox in R
Hello,
I am interested in Figure 2 in
http://www-stat.stanford.edu/~tibs/ftp/cus.pdf
Can anyone tell please how to create this plot?
Many thanks
Samuel
[[alternative HTML version deleted]]
2010 Jun 21
1
glm
Hi,
I have the following data
data1 <- data.frame(count = c(0,1,1,2,4,5,13,16,14), weeks = 1:9,
treat=c(rep("1mg",3),rep("5mg",3),rep("10mg",3)))
and I am using
library(splines)
to fit
glm.m <- glm(count~bs(weeks)+as.factor(treat),family=poisson,data=data1)
and I am interested in predicting the count variale for the weeks 10, 11 and
2013 Feb 25
1
creating variable that codes for the match/mismatch between two other variables
Dear all,
I have got two vectors coding for a stimulus presented in the current trial (mydat$Stimulus) and a prediction in the same trial (mydat$Prediciton), respectively.
By applying an if-conditional I want to create a new vector that indicates if there is a match between both vectors in the same trial. That is, if the prediction equals the stimulus.
When I pick out some trials randomly, I get
2018 Feb 25
0
include
Hi Val,
My fault - I assumed that the NA would be first in the result produced
by "unique":
mydat <- read.table(textConnection("Col1 Col2 col3
Z1 K1 K2
Z2 NA NA
Z3 X1 NA
Z4 Y1 W1"),header = TRUE,stringsAsFactors=FALSE)
val23<-unique(unlist(mydat[,c("Col2","col3")]))
napos<-which(is.na(val23))
preval<-data.frame(Col1=val23[-napos],
2013 Dec 08
2
How to evaluate sequence of strings like this
Hello Dear R community,
This is my problem. I have a data set (dataframe) called "mydat". It consist of 3 numerical variable. They are Centrecode, FSUSN and Round. I want to create unique ID by combining these 3 variables.
Follwing commands gives me what I need.
mydat1 <- paste(mydat$Centrecode, mydat$FSUSN,mydat$Round,sep="")
newds <- data.frame(mydat1)
For a
2010 Oct 11
2
(no subject)
Dear List,
I am trying to plot date vs. time, but am having problems getting my y-axis
labels how I want them.? When left on its own R plots time at 6 hour intervals
from 03:00 to 23:00.? I am wanting 6 hour intervals from 2:00 to 22:00.? I
realize yaxp doesn't work in plot(), so I am trying to get it to work in par().?
However, now I get the ticks where I want them but the time is output
2010 Dec 30
1
Sorting data.frame datewise in a descending order
Dear 'HTH' R friends
I have a small dataframe as given below. I need to sort this database based on date in a decending order. I am not sure whether I have defined the date column in a proper format.
mydat<-data.frame(date = (c("1/31/2010", "2/28/2010", "3/31/2010", "4/30/2010", "5/31/2010", "6/30/2010",
2018 Feb 25
2
include
HI Jim and all,
I want to put one more condition. Include col2 and col3 if they are not
in col1.
Here is the data
mydat <- read.table(textConnection("Col1 Col2 col3
K2 X1 NA
Z1 K1 K2
Z2 NA NA
Z3 X1 NA
Z4 Y1 W1"),header = TRUE,stringsAsFactors=FALSE)
The desired out put would be
Col1 Col2 col3
1 X1 0 0
2 K1 0 0
3 Y1 0 0
4 W1 0 0
6 K2 X1
2018 Feb 25
0
include
Jim has been exceedingly patient (and may well continue to be so), but this smells like "failure to launch". At what point will you start showing your (failed) attempts at solving your own problems so we can help you work on your specific weaknesses and become self-sufficient?
--
Sent from my phone. Please excuse my brevity.
On February 25, 2018 7:55:55 AM PST, Val <valkremk at
2018 Feb 25
0
include
hi Val,
Your problem seems to be that the data are read in as a factor. The
simplest way I can think of to get around this is:
mydat <- read.table(textConnection("Col1 Col2 col3
Z1 K1 K2
Z2 NA NA
Z3 X1 NA
Z4 Y1 W1"),header = TRUE,stringsAsFactors=FALSE)
preval<-data.frame(Col1=unique(unlist(mydat[,c("Col2","col3")]))[-1],
Col2=NA,col3=NA)
rbind(preval,mydat)
2018 Feb 25
3
include
Thank you Jim,
I read the data as you suggested but I could not find K1 in col1.
rbind(preval,mydat) Col1 Col2 col3
1 <NA> <NA> <NA>
2 X1 <NA> <NA>
3 Y1 <NA> <NA>
4 K2 <NA> <NA>
5 W1 <NA> <NA>
6 Z1 K1 K2
7 Z2 <NA> <NA>
8 Z3 X1 <NA>
9 Z4 Y1 W1
On Sat, Feb 24, 2018 at 6:18 PM, Jim
2011 Jun 28
1
lattice multiple y-scale possible?
Hi
I am attempting to use the lattice bwplot function to generate boxplots
of numerous parameters (1-panel/parameter) by site (x-axis). The
parameters have quite different ranges of values, so it would be best to
have a separate y-axis range for each panel. Below is a basic example of
what I am trying to do. As is seen, the y-axes need to be scaled
individually to make this useful. Any
2011 Jul 23
2
sum part of a vector
Dear colleagues, I have a data set that looks roughly like this;
mydat<-data.frame(state=c(rep("Alabama", 5), rep("Delaware", 5), rep("California", 5)), news=runif(15, min=0, max=8), cum.news=rep(0, 15))
For each state, I'd like to cumulatively sum the value of "news" and make that put that value in cum.news.
I'm trying as follows but I get