Displaying 20 results from an estimated 10000 matches similar to: "summing vectors"
2018 May 16
1
Systemfit Question
I can't get my simultaneous equations to work using system fit. Please help.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
str(Empdata)
Empdata$gnipc<-as.numeric(Empdata$gnipc)
install.packages("systemfit")
library("systemfit")
pdata <- plm.data(Empdata,
2017 Dec 14
3
help with recursive function
If you are trying to understand why the "stopifnot" condition is met you
can replace it by something like:
if ( any(dat2$norm_sd >= 1) )
browser()
This will put you in a debugging session where you can examine your
variables, e.g.
> dat$norm_sd
HTH,
Eric
On Thu, Dec 14, 2017 at 5:33 PM, Eric Berger <ericjberger at gmail.com> wrote:
> The message is coming from
2017 Dec 14
2
help with recursive function
Hi, I accidently left out few lines of code from the calclp function. Updated function is pasted below.
I am still getting the same error ?Error: !(any(data1$norm_sd >= 1)) is not TRUE?
I would appreciate any help.
Nilesh
dput(calclp)
function (dataset)
{
dat1 <- funlp1(dataset)
recursive_funlp <- function(dataset = dat1, func = funlp2) {
dat2 <- dataset %>%
2017 Dec 14
2
help with recursive function
My own typo ... whoops ...
!( any(dat2$norm_sd >= 1 ))
On Thu, Dec 14, 2017 at 3:43 PM, Eric Berger <ericjberger at gmail.com> wrote:
> You seem to have a typo at this expression (and some others like it)
>
> Namely, you write
>
> any(!dat2$norm_sd) >= 1
>
> when you possibly meant to write
>
> !( any(dat2$norm_sd) >= 1 )
>
> i.e. I think your !
2018 May 15
2
Systemfit
OK, Let's try this again! Here is the reproducible script; it is long because I had to copy the panel dataset here. My question is related to systemfit; I don't know how to get the result for the entire panel.
#Reproducible script
Empdata<- read.csv("/Users/ngwinuiazenui/Documents/UPLOADemp.csv")
View(Empdata)
install.packages("systemfit")
2017 Dec 14
0
help with recursive function
Eric: I will try and see if I can figure out the issue by debugging as you suggested. I don?t know why my code after stopifnot is not getting executed where I like the code to run the funlp2 function when the if statement is TRUE but when it is false, I like it to keep running until the stopifnot condition is met.
When the stopifnot condition is met, I like to get the output from if statement
2018 May 16
0
Systemfit
Sadly you failed to set your email program to send plain text and the data is corrupted at my end.
I also think you need to reduce the size of the data set... the intent here is to increase your understanding, not debug your particular analysis.
I will say that I am having a very challenging time understanding what you are trying to accomplish though. What are the equations that you think need
2018 May 15
0
Systemfit
... and the mailing list is picky about attachments... whatever you attached did not conform to the stringent requirements mentioned in the Posting Guide. Pasting the code right into the email is usually safest, though you DO have to post using plain text (as the Posting Guide indicates) or your code may get mangled by the automatic html format removal.
On May 15, 2018 7:04:31 AM PDT, Bert Gunter
2018 May 15
1
Systemfit
Unless there is good reason not to, always cc the list -- there are lots of
smarter folks than I on it who can help.
I may or may not have time to look at this. Hopefully someone else will.
-- Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip
2017 Dec 14
2
help with recursive function
Hi, I need some help with running a recursive function. I like to run funlp2 recursively.
When I try to run recursive function in another function named "calclp" I get this "Error: any(!dat2$norm_sd) >= 1 is not TRUE".
I have never built a recursive function before so having trouble executing it in this case. I would appreciate any help or guidance to resolve this issue.
2017 Dec 14
0
help with recursive function
Eric: Thanks for taking time to look into my problem. Despite of making the change you suggested, I am still getting the same error. I am wondering if the logic I am using in the stopifnot and if functions is a problem.
I like the recursive function to stop whenever the norm_sd column has zero values that are above or equal to 1. Below is the calclp function after the changes you suggested.
2017 Dec 14
0
help with recursive function
The message is coming from your stopifnot() condition being met.
On Thu, Dec 14, 2017 at 5:31 PM, DIGHE, NILESH [AG/2362] <
nilesh.dighe at monsanto.com> wrote:
> Hi, I accidently left out few lines of code from the calclp function.
> Updated function is pasted below.
>
> I am still getting the same error ?Error: !(any(data1$norm_sd >= 1)) is
> not TRUE?
>
>
>
2017 Dec 14
1
help with recursive function
Your code contains the lines
stopifnot(!(any(data1$norm_sd >= 1)))
if (!(any(data1$norm_sd >= 1))) {
df1 <- dat1
return(df1)
}
stop() "throws an error", causing the current function and all functions in
the call
stack to abort and return nothing. It does not mean to stop now and return
a result.
Does the function give
2017 Dec 14
0
help with recursive function
You seem to have a typo at this expression (and some others like it)
Namely, you write
any(!dat2$norm_sd) >= 1
when you possibly meant to write
!( any(dat2$norm_sd) >= 1 )
i.e. I think your ! seems to be in the wrong place.
HTH,
Eric
On Thu, Dec 14, 2017 at 3:26 PM, DIGHE, NILESH [AG/2362] <
nilesh.dighe at monsanto.com> wrote:
> Hi, I need some help with running a
2017 Oct 20
1
create a loop
Hi R Users,
I do have very big data sets and wanted to run some of the analyses many
times with randomization (1000 times).
I have done the analysis using an example data but it need to be done with
randomized data (1000 times). I am doing manually for 10000 times but
taking so much time, I wonder whether it is possible to perform the
analysis with creating a loop for many replicated datasets?
2012 Oct 29
4
replace repeated id in a pedigree list
Hello,
I have a pedigree file such this:
FAMID ID FA ID MO ID SEX STATUS
1 1 0 0 2 0
1 2 3 1 2 2
1 4 3 1 1 2
1 5 3 1 1 0
1 6 3 1 1 0
1 7 3 1 2 2
1 8 3 1 1 0
1 9 3 1 1 0
1 10 3 1 2 0
1 11 3 1 1 0
1 3 0 0 1 0
2 12 13
2018 May 28
3
How to generate a conditional dummy in R?
Hi everyone,
I am trying to generate a conditional dummy variable ?X" with the following rules
set X=1 if Y is =1, two years prior to the NA. [0,0,NA].
For example, if the pattern for Y is 0,0,NA then the X variable is =0 for all the two years prior to the NA. If the pattern for Y is 0,1,NA or 1,0,NA then the X =1 . To be clear, if 1,1,NA then the X=1 that first specific year, it
2009 Oct 09
1
Placing text in a ggplot
I am attempting to graph 12 months of temperatures, delineate the months with a vline and place the names of the months at the top of the graph.
So far I have gotten everything to work except the names, despite getting a similar graph to work yesterday the day before yesterday with Baptise A's help. Can anyone suggest what I am doing wrong. Data set is below code.
Thanks.
Code
2017 Jul 22
1
3-day moving average for block maxima
Dear r-users,
I would like to construct 3-day moving average for block maxima series.
I tried this:
bmthree <- lapply(split(dt, dt$Year), function(x) max(sapply(1:(nrow(x)-2),
function(i) with(x, mean(Amount[i:(i+2)],na.rm=TRUE)))))
bmthree
and got the following output.
$`1971`
[1] 70.81667
$`1972`
[1] 68.94553
$`1973`
[1] 102.7236
$`1974`
[1] 73.6625
$`1975`
[1]
2012 May 09
12
Matrix heatmap
I would like to organize my data as follows:
I have a table that contains various data, and the numbers represent a level
of similarity between these data,
eg RF00013 has 100% similarity with the data RF00014.
I would leave my table as a heatmap where darker colors represent higher
similarity, and the lighter colors represent less level of similarity.
I'm using version 2.11 of R.
these