Displaying 20 results from an estimated 41 matches for "xx2".
Did you mean:
0x2
2013 Jan 10
2
transparency in segments()
...all,
i would like to plot each value from my datasets as segment with defined
transparency
However, I didnt find out how to set the transparency.
definition by "col=" in par() or segments() doesnt seem to work
any suggestions?
Thanks in advance.
Kind regards,
Robert Pazur
example code:
xx2 <-read.table("http://www.scandinavia.sk/data/R/0_05.csv", sep=";",
header=T)
plot(xx2$MEAN_PERI,ylim=c(50,350),xlim=c(1,30000),log= "x",
yaxt='n',ylab="",xlab="mean", type = "n")
segments(xx2$MEAN_PERI, 60,xx2$MEAN_PERI, 100, tc...
2023 Oct 31
1
weights vs. offset (negative binomial regression)
...*not* check overdispersion of the raw data
> (i.e., the *marginal distribution* of the data, you should check
> overdispersion of a fitted (e.g. Poisson) model, as below.
>
> ? ?cheers
> ? ? Ben Bolker
>
>
> edata <- data.frame(Catch, Effort, xx1, xx2, xx3)
>
> ## graphical exploration
>
> library(ggplot2); theme_set(theme_bw())
> library(tidyr)
> edata_long <- edata |> pivot_longer(names_to="var", cols =-c("Catch",
> "Effort"))
> ggplot(edata_long, aes(value,...
2004 Dec 03
1
Difficulty implementing "scales" in a lattice plot
...s the problem I am having.
Scanf is a factor with 20 levels and the mean values for these levels are being plotted with CIs.
I am trying to reduce the text size for the labels for this variable. The first function below does not attempt to set the text size for the y axes, and all works well.
xx2 <- with(xx,summarize(q27a, llist(Scanf,bumo), smean.cl.boot, conf.int=.90))
Dotplot(Scanf ~ Cbind(q27a,Lower, Upper)| bumo, xlim=c(5,10),cex=.6, par.strip.text=list(cex=.8), xlab="",main="", data=xx2)
Now, when I add to the above function, scales=(cex=.5), as I show in th...
2017 Oct 09
0
example of geom_contour() with function argument
library(mvtnorm) # you were misusing "require"... only use require if
you plan to
library(ggplot2) # test the return value and fail gracefully when the
package is missing
set.seed( 1234 )
xx <- data.frame( rmvt( 100, df = c( 13, 13 ) ) )
xx2 <- expand.grid( X1 = seq( -5, 5, 0.1 ) # all combinations... could
be used to fill a matrix
, X2 = seq( -5, 5, 0.1 )
)
# compute density as a function of the grid of points
xx2$d <- dmvt( as.matrix( xx2[,1:2] ) ) # feels weird not specifying
measures of...
2012 Mar 18
1
Converting expression to a function
...xperience is encouraging.
John Nash
# --------- code block -----------
rm(list=ls()) # clear workspace
Form2resfun <- function(f, p ) {
cat("In Form2resfun\n")
xx <- all.vars(f)
fp <- match(names(p), xx) # Problem in matching the names of params
xx2 <- c(xx[fp], xx[-fp])
ff <- vector("list", length(xx2))
names(ff) <- xx2
sf<-as.character(f)
if ((length(sf)!=3) && (sf[1]!="~")) stop("Bad model formula expression")
lhs<-sf[2] # NOTE ORDER formula with ~...
2011 Nov 17
1
Vectorizing for weighted distance
Hi All,
I am trying to convert the following piece of matlab code to R:
XX1 = sum(w(:,ones(1,N1)).*X1.*X1,1); #square the elements of X1,
weight it and repeat this vector N1 times
XX2 = sum(w(:,ones(1,N2)).*X2.*X2,1); #square the elements of X2,
weigh and repeat this vector N2 times
X1X2 = (w(:,ones(1,N1)).*X1)'*X2; #get the weighted
'covariance' term
XX1T = XX1'; #transpose
z = XX1T(:,ones(1,N...
2009 Jun 29
2
How to read a list into R??
Dear R helpers:
I have tried many times to find some way to read a list into R. But I faid. Here is an example:
I have a file 'List.txt' which includes data as follows:
[[1]]
[1] 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.5 0.0 0.0 0.0
[19] 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
[[2]]
[1] 0.0000000 0.5000000 0.0000000 0.0000000
1999 Feb 16
1
Missing tick marks bug on alpha solved
...gt; plot(0:1,axes=FALSE)
> axis(1,1:2)
The problem is in X11_Line(...) from .../src/unix/devX11.c, which is
so short I've included the whole function below:
static void X11_Line(double x1, double y1, double x2, double y2,
int coords, DevDesc *dd)
{
double xx1, yy1, xx2, yy2; <----------- should be int!
x11Desc *xd = (x11Desc *) dd->deviceSpecific;
/* In-place conversion ok */
GConvert(&x1, &y1, coords, DEVICE, dd);
GConvert(&x2, &y2, coords, DEVICE, dd);
xx1 = (int) x1;
yy1 = (int) y1;
xx2 = (int) x...
2007 Dec 02
2
Optimised qmf_synth and iir_mem16
....global qmf_synth
qmf_synth:
stmdb sp!, { r4-r11, lr }
add r7, sp, #36 @ r0 = x1, r1 = x2, r2 = a, r3 = y
ldmia r7, { r4-r7 } @ r4 = N, r5 = M, r6 = mem1, r7 = mem2
add r8, r4, r5
sub r9, sp, r8 @ r9 = sp - (N + M >> 1) = xx2
sub r8, r9, r8 @ r8 = r9 - (N + M >> 1) = xx1
str sp, [r8, #-4] @ Stack old sp
sub sp, r8, #4 @ Update sp
add r0, r0, r4 @ x1 += N >> 1
add r1, r1, r4 @ x2 += N >> 1
mov...
2017 Oct 09
3
example of geom_contour() with function argument
Hi,
This is not a HW problem, sadly: I was last in a classroom 30 years ago,
and can no longer run off to the instructor :-(
I apologize but I cut and paste the wrong snippet earlier and made a typo
in doing so, but the result is the same with the more appropriate snippet.
require(mvtnorm)
require(ggplot2)
set.seed(1234)
xx <- data.frame(rmvt(100, df = c(13, 13)))
v <- ggplot(data = xx,
2010 Aug 17
3
predict.lm, matrix in formula and newdata
Dear all,
I am stumped at what should be a painfully easy task: predicting from an lm object. A toy example would be this:
XX <- matrix(runif(8),ncol=2)
yy <- runif(4)
model <- lm(yy~XX)
XX.pred <- data.frame(matrix(runif(6),ncol=2))
colnames(XX.pred) <- c("XX1","XX2")
predict(model,newdata=XX.pred)
I would have expected the last line to give me the predictions from the model based on the new data given in XX.pred... but all I get are in-sample fits along with a warning "'newdata' had 3 rows but variable(s) found have 4 rows". Why would...
2009 Mar 28
1
Error in R??
...##sample from full conditional distribution of Si
#Prob(Si = 1)
for (j in 1:N)
{
numerat =
currphi1*exp((-1/(2*currvar))*t(Y1-(t(XX1)%*%currbeta1))%*%(Y1-(t(XX1)%*%currbeta1)))
denomin =
currphi2*exp((-1/(2*currvar))*t(Y2-(t(XX2)%*%currbeta2))%*%(Y2-(t(XX2)%*%currbeta2)))
sum=denomin + numerat
ProbSi = numerat/sum
arunofSi[j]=rbinom(1,1,ProbSi) #Generate 50 Bernoulli rvs and
assign them to arunofSi array
}
N0=sum(arunofSi==0) #We check the number of zeros in...
2007 Jan 30
2
dev IFB, few questions
I''ve made some tests...
eth2 is my internal interface, LAN is connected here.
Before I had IMQ device in AB mode...
PREROUTING [A]fter NAT, POSTROUTING [B]efore NAT.
I want the same situation on ifb.
I do this in this way:
---
# incoming traffic here from LAN is before NAT
tc qdisc add dev eth2 handle ffff: ingress
# outcoming traffic here from WAN is after NAT
tc qdisc add dev eth2
2003 Jul 08
2
Can anybody help me on this?
Hi there:
I have this configuration:
|-----[Server 2]
|
[Internet]--------[Router]----------[Switch]------------ [Server 1]
|
|-----[PC1]
|
|-----[PC2]
|
|-----[PC3]
Server 1 has IP 216.251.XXX.XX1
Server 2 has IP 216.251.XXX.XX2
PC1 has IP 216.251.XXX.XX3
PC2 has IP 192.168.XXX.1
PC3 has IP 192.168.XXX.2
How do I configure shorewall in SERVER 2 to block to/from the Internet Port
22 (ssh), but do not block port 22 from PC1 and PC2 and PC3 ???
Currently I have shorewall confufured like "quick-guide one interface
examp...
2007 Oct 14
1
iPhone 1.1.1 problems.
...ee the packets passing back and forth in a number of ways, but
haven't been able to see the contents. I tried turning on raw logging,
but don't get log files for accesses from the iPhone. What I get are
lines like so:
Oct 13 00:08:34 bhuda dovecot: imap-login: Disconnected: rip=xxx.xxx.xxx.xx2, lip=xxx.xxx.xxx.xx1, TLS
Turning off SSL both ways, and the message changes to:
Oct 13 18:21:38 bhuda dovecot: imap-login: Aborted login: rip=xxx.xxx.xxx.xx2, lip=xxx.xxx.xxx.xx1
Tweaking the logging in the firewall reveals something interesting:
apparently the phone makes the connection to 993...
2010 Jul 15
3
Creating Enumerated Variables
Hi,
I am trying to create a variable counting the number of individuals based on
two variables. I am able to do it or one variable, but not two. In SAS I was
able to sort by two variables and use a first. statement to create the
counts based on both. Here is an example:
What I have
ID Age School Grade
1 10 1 98
2 10 2 97
3 10 1 92
4 11 1 90
5 11 1 80
6 11 2 70
7 10 1 80
2008 Nov 19
1
F-Tests in generalized linear mixed models (GLMM)
...cts:
Formula: ~1 | random1
(Intercept) Residual
StdDev: 2.954058e-05 0.9775214
Variance function:
Structure: fixed weights
Formula: ~invwt
Fixed effects: list(fixed)
Value Std.Error DF t-value p-value
X(Intercept) 5.066376 0.08363392 295 60.57801 0e+00
Xx1TRUE 0.884486 0.11421762 295 7.74387 0e+00
Xx2 0.234537 0.05851689 295 4.00802 1e-04
Correlation:
X(Int) X1TRUE
Xx1TRUE -0.733
Xx2 -0.008 0.085
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.0207671 -0.6911364 -0.2899184 0.3665161 4.9603830
Number of Observations: 300
Number of Groups: 3
> summary(glm1.gamma$gam)
Family: Gamma...
2008 Dec 16
8
sliding window over a large vector
Hi all,
I have a very large binary vector, I wish to calculate the number of
1's over sliding windows.
this is my very slow function
slide<-function(seq,window){
n<-length(seq)-window
tot<-c()
tot[1]<-sum(seq[1:window])
for (i in 2:n) {
tot[i]<- tot[i-1]-seq[i-1]+seq[i]
}
return(tot)
}
this works well for for reasonably sized vectors. Does
2008 Oct 01
0
xpred.rpart() in library(mvpart)
...t - car.test.frame$Mileage)^2
apply(xerr, 2, sum) # cross-validated error estimate
# approx same result as rel. error from printcp(fit)
apply(xerr, 2, sum)/var(car.test.frame$Mileage)
printcp(fit)
I carried out the R object:
function ()
{
#
library(mvpart)
xx1 <- c(1,2,3,4,5,6,7,8,9,10)
xx2 <- c(5,2,1,4,3,6,2,8,2,2)
xx3 <- c(9,8,3,7,2,3,1,9,1,6)
yy <- c(1,8,2,7,4,3,1,2,2,8)
data1 <- data.frame(x1=xx1, x2=xx2, x3=xx3, y=yy)
set.seed(345)
rpart.out1 <- rpart(y~., data=data1)
re1 <- rpart.out1$cptable[,"rel error"]
print("re1")
print(...
2010 Oct 14
0
AMD/Supermicro machine - AS-2022G-URF
...86 (AuthenticAMD 100F91 family 16 model 9 step 1 clock 2100 MHz)
AMD Opteron(tm) Processor 6172 [ Socket: G34 ]
# zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
rpool 928G 13.5G 914G 1% 1.00x DEGRADED -
xxx1 14.5T 1.41T 13.1T 9% 4.54x ONLINE -
xx2 7.25T 109G 7.14T 1% 1.00x ONLINE -
# zpool status
pool: rpool
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for
the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using '...