Re: [R] R ioanalysis pkg

2020-11-10 Thread Jim Lemon
Hi Gaspar,
I can see why you are having trouble with this. The "as.inputoutput"
function seems to be the core. While the manual claims you can just input
the "Z", "RS_label" and and "X" matrices to "as.inputoutput" and get the
"InputOutput" object that you need for all the other functions, it looks to
me as though the required input matrices are not trivial to create. The
manual is confusing as the argument name "Z" is overprinted by "RS_label"
My guess is that you will have to know a bit about what you are doing to
use the package.

Jim

On Wed, Nov 11, 2020 at 11:55 AM Gaspar Núñez  wrote:

> Hi,
>
> Hope you are doing well, I´m trying to start working
> with ioanalysis package, however its being difficult for me
> to prepare data from my own input-output table,
> import it into R in order to apply the ioanalysis functions
> Any help on this will be highly appreciated.
> Please note that I do not need links to the ioanalysis manual
> nor to pages describing the package and its functions,
> but something like a tutorial or worked example on
> how to prepare data from the input-output table
> import data into R, so that after that i can work with ioanalysis
>
> Thank you very much in advance
>
> Gaspar Núñez
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R ioanalysis pkg

2020-11-10 Thread David Winsemius



On 11/10/20 5:08 PM, Bert Gunter wrote:

There are around 20,000 specialized packages for R. This list is set up to
help on standard R features and packages, but cannot possibly be expected
to support 20,000 packages. As the posting guide says (did you read it??!):

"If the question relates to a *contributed package* , e.g., one downloaded
from CRAN, try contacting the package maintainer first. You can also use
find("functionname") and packageDescription("packagename") to find this
information. *Only* send such questions to R-help or R-devel if you get no
reply or need further assistance. This applies to both requests for help
and to bug reports."
(Note also: ?maintainer)

So did you you do this?

Bert Gunter


To follow up on this ... the StackOverflow forum also handles coding
questions but it specifically advises against posting overly broad
questions or requests for package recommendations or other requests for
external sources of programming advice or tutoring.

Like Rhelp, SO advises questioners is to prepare a test dataset and to show 
what efforts have been made using R code. The code should preferably install 
the package and then load it. It should then make whatever preliminary 
transformations you have attempted along with the compete error messages or 
descriptions of what results failed to meet your expectations.

Neither Rhelp or SO should be considered as sources for one-off tutorials or as 
places to ask for one-off projects builds.

--
David.

 On Tue, Nov 10, 2020 at 4:55 PM Gaspar Núñez  wrote:


Hi,

Hope you are doing well, I´m trying to start working
with ioanalysis package, however its being difficult for me
to prepare data from my own input-output table,
import it into R in order to apply the ioanalysis functions
Any help on this will be highly appreciated.
Please note that I do not need links to the ioanalysis manual
nor to pages describing the package and its functions,
but something like a tutorial or worked example on
how to prepare data from the input-output table
import data into R, so that after that i can work with ioanalysis

Thank you very much in advance

Gaspar Núñez

 [[alternative HTML version deleted]
And  Rhelp does not accept HTML code. If you had included code, it 
would probably have been mangles. Use plain text.


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R ioanalysis pkg

2020-11-10 Thread Bert Gunter
There are around 20,000 specialized packages for R. This list is set up to
help on standard R features and packages, but cannot possibly be expected
to support 20,000 packages. As the posting guide says (did you read it??!):

"If the question relates to a *contributed package* , e.g., one downloaded
from CRAN, try contacting the package maintainer first. You can also use
find("functionname") and packageDescription("packagename") to find this
information. *Only* send such questions to R-help or R-devel if you get no
reply or need further assistance. This applies to both requests for help
and to bug reports."
(Note also: ?maintainer)

So did you you do this?

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 )


On Tue, Nov 10, 2020 at 4:55 PM Gaspar Núñez  wrote:

> Hi,
>
> Hope you are doing well, I´m trying to start working
> with ioanalysis package, however its being difficult for me
> to prepare data from my own input-output table,
> import it into R in order to apply the ioanalysis functions
> Any help on this will be highly appreciated.
> Please note that I do not need links to the ioanalysis manual
> nor to pages describing the package and its functions,
> but something like a tutorial or worked example on
> how to prepare data from the input-output table
> import data into R, so that after that i can work with ioanalysis
>
> Thank you very much in advance
>
> Gaspar Núñez
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R ioanalysis pkg

2020-11-10 Thread Gaspar Núñez
Hi,

Hope you are doing well, I´m trying to start working
with ioanalysis package, however its being difficult for me
to prepare data from my own input-output table,
import it into R in order to apply the ioanalysis functions
Any help on this will be highly appreciated.
Please note that I do not need links to the ioanalysis manual
nor to pages describing the package and its functions,
but something like a tutorial or worked example on
how to prepare data from the input-output table
import data into R, so that after that i can work with ioanalysis

Thank you very much in advance

Gaspar Núñez

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R-es] Help propensity score

2020-11-10 Thread Cristian Rodelo-Haad
Hola chic@s, alguien con experiencia en propensión score matching?

Planteo duda: Clasicamente el PSM se ha utilizado en un intento de homogeneizar 
cohortes de enfermos quienes han estado “expuestos” a un tratamiento x Vs 
aquellos que no han estado expuestos (no expuestos). Esto aplica para 
medicamentos o procedimientos quirúrgicos o no.

Bien, En algún articulo he leído que el PSM se puede utilizar como un elemento 
de clasificación y por tanto de homogeneización. 
Mi intención es aplicar el PSM a un análisis de supervivencia. En este sentido 
mi hipótesis es que una variable “x” tanto en su versión cuantitativa como 
categorizada a terciles,cuartiles o quintiles influye sobre la supervivencia de 
los sujetos. Esto entiendo que puedo resolverlo con un análisis de 
supervivencia y posteriormente con una regresión de Cox. Este método seria 
valido desde el punto de vista estadístico si bien desde el punto de vista 
biológico podría tener alguna duda de interpretación sobretodo por la inclusión 
en los modelos de variables colineales o con interacción.
Por otro lado el PSM me permitiría balancear todas las variables desde el 
primer momento e incluirlos en el análisis de supervivencia con la premisa de 
que parten de valores iguales/cuasi-iguales.

Aquí es donde tengo dudas: si decido aplicar el PSM
Como debo realizar esta homogeneización?

1. Si tengo 2 estados por ejemplo vivo vs Muerto?—> Calculo el riesgo de 
propensión a partir de esta variable “estado” cuando realize el glm inicial ya 
que mi variable de exposición/tratamiento es estar vivo o Muerto?
2. Utilizar mi variable “x” categorizada como variable exposición y partir de 
esta calcular el score de propensión?

Muchas gracias, espero haber sido claro.

Saludos,




Cristian Rodelo-Haad
crisroh...@gmail.com

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [ESS] how to change default emacs behavior, upon running R code, from 2 side-by-by side frames to top-and-bottom frames?

2020-11-10 Thread Marc Schwartz via ESS-help
Hi,

FWIW, I had the same issue at some point in the past, and I have the following 
in my .emacs to change the behavior:

(add-to-list 'display-buffer-alist '("*R" (display-buffer-reuse-window 
display-buffer-at-bottom)
 (window-width . 0.5) (reusable-frames . nil)))

That was provided here on the list some time ago, and perhaps there is a more 
recent incantation, if things have changed since then.

Regards,

Marc Schwartz


> On Nov 10, 2020, at 8:37 AM, Tyler Smith via ESS-help 
>  wrote:
> 
> Christopher W. Ryan via ESS-help writes:
> 
>> When I execute a line of R code, the R buffer opens up as expected, but
>> it opens in a frame adjacent to the frame containing my source buffer. I
>> would like it to open the R buffer as a frame below my source code,
>> rather than adjacent to it.Â
>> 
>> How can I change the behavior from side-side frames to top-bottom frames?
> 
> In base Emacs, this is controlled by the variables `split-height-threshold` 
> and `split-width-threshold`. Setting split-height-threshold to a lower value 
> (default is 80), and the width threshold to a higher value, will prioritize 
> splitting top/bottom over right/left.
> 
> The info node for this is: (emacs) Window Choice
> 
> Best,
> 
> Tyler
> 
> -- 
> Tyler Smith
> plantarum.ca
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] how to change default emacs behavior, upon running R code, from 2 side-by-by side frames to top-and-bottom frames?

2020-11-10 Thread Tyler Smith via ESS-help

Christopher W. Ryan via ESS-help writes:

When I execute a line of R code, the R buffer opens up as 
expected, but
it opens in a frame adjacent to the frame containing my source 
buffer. I
would like it to open the R buffer as a frame below my source 
code,

rather than adjacent to it.Â

How can I change the behavior from side-side frames to 
top-bottom frames?


In base Emacs, this is controlled by the variables 
`split-height-threshold` and `split-width-threshold`. Setting 
split-height-threshold to a lower value (default is 80), and the 
width threshold to a higher value, will prioritize splitting 
top/bottom over right/left.


The info node for this is: (emacs) Window Choice

Best,

Tyler

--
Tyler Smith
plantarum.ca

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [R] Remove all factor levels from an R dataframe

2020-11-10 Thread Eric Berger
Hi John,
I was thinking that you created df1 in a way that set the 'year'
column as a factor when this is not what you wanted to do.
The data.frame() function takes an argument stringsAsFactors which
controls this behavior.
For R versions 3.6.3 or earlier, the default setting is
stringsAsFactors=TRUE, which means that string columns automatically
become factors.
You have to specify stringsAsFactors=FALSE to avoid this. (In R 4.0.x
the default was changed to FALSE.)

Example:
df1 <- data.frame( a=letters[1:10], stringsAsFactors=FALSE )

HTH,
Eric

On Tue, Nov 10, 2020 at 11:16 AM Jim Lemon  wrote:
>
> Sure John,
>
> df1<-df1[order(as.character(df1$year),decreasing=TRUE),]
>
> Jim
>
> On Tue, Nov 10, 2020 at 8:05 PM John  wrote:
>
> > Thanks Jim. Can we do descending order?
> >
> > Jim Lemon  於 2020年11月10日 週二 下午4:56寫道:
> >
> >> Hi John,
> >>
> >> df1<-sapply(df1,as.character)
> >>
> >> Should do what you ask. The error message probably means that you should
> >> do this:
> >>
> >> df1<-df1[order(as.character(df1$year)),]
> >>
> >> as "year" is the name of the first column in df1, not a separate object.
> >>
> >> Jim
> >>
> >> On Tue, Nov 10, 2020 at 6:57 PM John  wrote:
> >>
> >>> Hi,
> >>>
> >>>I would like to sort the following simple dataframe by "year"
> >>> (characters), but the factor structure prevents me from doing so. How
> >>> can I
> >>> remove the factor structure? Thanks!
> >>>
> >>> > df1
> >>>   year  country
> >>> 4 2007 Asia; survey
> >>> 5 2010 8 countries in E/SE Asia
> >>> 6 2015Ghana
> >>> 7
> >>> 8 2000  US?
> >>> > str(df1)
> >>> 'data.frame': 5 obs. of  2 variables:
> >>>  $ year   : Factor w/ 9 levels "2017","2016",..: 4 5 3 6 7
> >>>  $ country: Factor w/ 9 levels "Euro Area\\newline Testing the MP
> >>> performance of the Euro Area",..: 4 5 6 7 8
> >>> > df1[order(-year), ]
> >>> Error in order(-year) : object 'year' not found
> >>>
> >>> [[alternative HTML version deleted]]
> >>>
> >>> __
> >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >>> https://stat.ethz.ch/mailman/listinfo/r-help
> >>> PLEASE do read the posting guide
> >>> http://www.R-project.org/posting-guide.html
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>>
> >>
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Remove all factor levels from an R dataframe

2020-11-10 Thread Jim Lemon
Sure John,

df1<-df1[order(as.character(df1$year),decreasing=TRUE),]

Jim

On Tue, Nov 10, 2020 at 8:05 PM John  wrote:

> Thanks Jim. Can we do descending order?
>
> Jim Lemon  於 2020年11月10日 週二 下午4:56寫道:
>
>> Hi John,
>>
>> df1<-sapply(df1,as.character)
>>
>> Should do what you ask. The error message probably means that you should
>> do this:
>>
>> df1<-df1[order(as.character(df1$year)),]
>>
>> as "year" is the name of the first column in df1, not a separate object.
>>
>> Jim
>>
>> On Tue, Nov 10, 2020 at 6:57 PM John  wrote:
>>
>>> Hi,
>>>
>>>I would like to sort the following simple dataframe by "year"
>>> (characters), but the factor structure prevents me from doing so. How
>>> can I
>>> remove the factor structure? Thanks!
>>>
>>> > df1
>>>   year  country
>>> 4 2007 Asia; survey
>>> 5 2010 8 countries in E/SE Asia
>>> 6 2015Ghana
>>> 7
>>> 8 2000  US?
>>> > str(df1)
>>> 'data.frame': 5 obs. of  2 variables:
>>>  $ year   : Factor w/ 9 levels "2017","2016",..: 4 5 3 6 7
>>>  $ country: Factor w/ 9 levels "Euro Area\\newline Testing the MP
>>> performance of the Euro Area",..: 4 5 6 7 8
>>> > df1[order(-year), ]
>>> Error in order(-year) : object 'year' not found
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Remove all factor levels from an R dataframe

2020-11-10 Thread John
Thanks Jim. Can we do descending order?

Jim Lemon  於 2020年11月10日 週二 下午4:56寫道:

> Hi John,
>
> df1<-sapply(df1,as.character)
>
> Should do what you ask. The error message probably means that you should
> do this:
>
> df1<-df1[order(as.character(df1$year)),]
>
> as "year" is the name of the first column in df1, not a separate object.
>
> Jim
>
> On Tue, Nov 10, 2020 at 6:57 PM John  wrote:
>
>> Hi,
>>
>>I would like to sort the following simple dataframe by "year"
>> (characters), but the factor structure prevents me from doing so. How can
>> I
>> remove the factor structure? Thanks!
>>
>> > df1
>>   year  country
>> 4 2007 Asia; survey
>> 5 2010 8 countries in E/SE Asia
>> 6 2015Ghana
>> 7
>> 8 2000  US?
>> > str(df1)
>> 'data.frame': 5 obs. of  2 variables:
>>  $ year   : Factor w/ 9 levels "2017","2016",..: 4 5 3 6 7
>>  $ country: Factor w/ 9 levels "Euro Area\\newline Testing the MP
>> performance of the Euro Area",..: 4 5 6 7 8
>> > df1[order(-year), ]
>> Error in order(-year) : object 'year' not found
>>
>> [[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Remove all factor levels from an R dataframe

2020-11-10 Thread Jim Lemon
Hi John,

df1<-sapply(df1,as.character)

Should do what you ask. The error message probably means that you should do
this:

df1<-df1[order(as.character(df1$year)),]

as "year" is the name of the first column in df1, not a separate object.

Jim

On Tue, Nov 10, 2020 at 6:57 PM John  wrote:

> Hi,
>
>I would like to sort the following simple dataframe by "year"
> (characters), but the factor structure prevents me from doing so. How can I
> remove the factor structure? Thanks!
>
> > df1
>   year  country
> 4 2007 Asia; survey
> 5 2010 8 countries in E/SE Asia
> 6 2015Ghana
> 7
> 8 2000  US?
> > str(df1)
> 'data.frame': 5 obs. of  2 variables:
>  $ year   : Factor w/ 9 levels "2017","2016",..: 4 5 3 6 7
>  $ country: Factor w/ 9 levels "Euro Area\\newline Testing the MP
> performance of the Euro Area",..: 4 5 6 7 8
> > df1[order(-year), ]
> Error in order(-year) : object 'year' not found
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.