Displaying 20 results from an estimated 1000 matches similar to: "logistic regression in R - changing defaults"
2006 Jun 06
2
Error in inherits(x, "data.frame") : object "Dataset" not found
I have been trying to run a logistic regression using a number of studies.
Below is the syntax, error message & data.
Any advice regarding what I am doing wrong or solutions are appreciated,
regards
Bob Green
> logreg <- read.csv("c:\\logregtest.csv",header=T)
> attach(logreg)
> names(logreg)
[1] "medyear" "where" "who"
2006 Jun 04
1
logistic regression enquiry
I am hoping for some advie regarding the following scenario.
I have data from 26 studies that I wanted to analyse using logistic
regression. Given the data was from studies and not individuals I was
unsure how I would perform this in R. When analysed in SPSS, weighting was
used so that each study was included twice. Where "use" occurred, a value
of 1 was assigned and was weighted
2006 Jun 19
2
saving rounded numbers as a new variable in a dataframe
A basic question, but one that eludes me. I have created a new variable
$numurder, which I have rounded off. I want to save the rounded off version
of this variable to an existing datafile called 'ngri.csv' .
numurder <-c((murder*no.of.cases)/100)
[[1]]
[1] 48.952 112.073 182.160 974.610 122.140 663.432 150.856 18.988
137.925 198.045 68.930 203.148 30.056 100.955
2006 Sep 10
2
formatting data to be analysed using multinomial logistic regression (nnet)
I am looking into using the multinomial logistic regression option in the
nnet library and have two questions about formatting the data.
1. Can data be analysed in the following format or does it need to be
transformed into count data, such as the housing data in MASS?
Id Crime paranoia hallucinate toc disorg crimhist age
1 2 1 0 1 0 1 25
2 2 0 1 1 1 1 37
3 1 1 0 1 1 0 42
4 3 0
2007 Dec 16
4
improving a bar graph
Hello,
Below is the code for a basic bar graph. I was seeking advice
regarding the following:
(a) For each time period there are values from 16 people. How I can
change the colour value so that each person has a different colour,
which recurs across each of the three graphs/tie epriods?
(b) I have seen much more sophisticated examples using lattice (e.g
each person has a separate
2007 Mar 26
1
fitted probabilities in multinomial logistic regression are identical for each level
I was hoping for some advice regarding possible explanations for the
fitted probability values I obtained for a multinomial logistic
regression. The analysis aims to predict whether Capgras delusions
(present/absent) are associated with group (ABH, SV, homicide; values
= 1,2,3,), controlling for previous violence. What has me puzzled is
that for each combination the fitted probabilities are
2007 Jun 28
2
logistic regression and dummy variable coding
Hello everyone,
I have a variable with several categories and I want to convert this
into dummy variables and do logistic regression on it. I used
model.matrix to create dummy variables but it always picked the
smallest one as the reference. For example,
model.matrix(~.,data=as.data.frame(letters[1:5]))
will code 'a' as '0 0 0 0'. But I want to code another category as
2013 May 01
2
Factors and Multinomial Logistic Regression
Dear All,
I am trying to reproduce the example that I found online here
http://bit.ly/11VG4ha
However, when I run my script (pasted at the end of the email), I notice
that there is a factor 2 between the values for the coefficients for the
categorical variable female calculated by my script and in the online
example.
Any idea about where this difference comes from?
Besides, how can I
2010 Aug 09
3
Logistic Regression in R (SAS -like output)
Hello useRs,
I have a problem at hand which I'd think is fairly common amongst
groups were R is being adopted for Analytics in place of SAS.
Users would like to obtain results for logistic regression in R that
they have become accustomed to in SAS.
Towards this end, I was able to propose the Design package in R which
contains many functions to extract the various metrics that SAS
reports.
2023 Jul 26
1
Downloading a directory of text files into R
?s 23:06 de 25/07/2023, Bob Green escreveu:
> Hello,
>
> I am seeking advice as to how I can download the 833 files from this
> site:"http://home.brisnet.org.au/~bgreen/Data/"
>
> I want to be able to download them to perform a textual analysis.
>
> If the 833 files, which are in a Directory with two subfolders were on
> my computer I could read them
2005 Dec 20
1
Wilcoxon Mann-Whitney Rank Sum Test in R
An earlier post had posed the question: "Does anybody know what is relation
between 'T' value calculated by 'wilcox_test' function (coin package) and
more common 'W' value?"
I found the question interesting and ran the commands in R and SPSS. The W
reported by R did not seem to correspond to either Mann-Whitney U,
Wilcoxon W or the Z which I have more
2006 Aug 06
1
ordering by a datframe date
I am hoping for some advice regarding ordering a dataframe, by date.
The dataframe is in the format below.
$story $datepub
story10 1 April 1999
story 90 1 March 2002
story 37 10 July 1985
I want to reorder the entire dataframe so the earliest story is first, and
save the reordered dataframe. The command, 'class' (datepub) reveals
$datepub is a factor variable.
I tried
2006 Aug 31
1
grep question
I am hoping for some advice as to how to modify the following syntax, so
that instead of saving all records which refer to Farrah, I select all
instances that do not include Farrah, or the word Coolum.
test <- read.csv("c:\\newdat.csv", as.is=TRUE, header=T)
sure <- test[grep('Farrah', paste(test$V3.HD, test$V3.LP, test$V3.TD)),]
2007 Nov 29
1
Prorating scale items
Hello,
I am hoping for some advice as to how I can prorate a number of scale
items that comprise a score. At least 69 of 159 cases have at least 1
value missing (65 cases have H7 missing). The maximum number of missing is
5.
I want to compute a total score, a score for the H items, the R items and
C items.
H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, C1, C2, C3, C4, C5, R1, R2, R3,
R4, R5
I am
2010 Mar 12
1
Print density of 600 dpi for a plot
I have to create a plot with a print density of 600 dpi . Within R,
is there a way to determine the print density of a plot?
Any assistance is much appreciated,
regards
Bob
2009 Apr 04
1
comparing columns in a dataframe
hello,
I am hoping for some advice regarding comparing variables from 3
versions of a spreadsheet which have been combined into a single
dataframe. The aim is to identify which rows have been changed.
The dataframe contains 177 rows of data (each cell contains text).
'intersect' produced a file with 35 rows, 'union' a file with 303
rows and 'setdiff' a file with 130
2009 Jan 09
2
recursive relevel
Dear list,
I'm having second thoughts after solving a very trivial problem: I
want to extend the relevel() function to reorder an arbitrary number
of levels of a factor in one go. I could not find a trivial way of
using the code obtained by getS3method("relevel","factor"). Instead, I
thought of solving the problem in a recursive manner (possibly after
reading
2010 Aug 03
1
releveling a numeric by factor interaction
Can anyone help me with the necessary code to relevel a numeric*factor
interaction term in a linear model? I would like to report the estimate,
std. error and t-value for the reference factor.
First, I estimated a linear model with dummy variables and was able to
retrieve model estimates for the reference factor using relevel.
for example:
> summary(update(mod.mod, . ~ . - dummy +
+
2011 Jan 14
1
CSV value not being read as it appears
I have a frustrating issue which I am hoping someone may have a suggestion
about.
I am running XP and R 2.12.0 and saved an EXCEL file that I was sent as a
csv file.
The initial code I ran follows.
dec <- read.csv("g://FMH/FO30122010.csv",header=T)
dec.open <- subset (dec, Status == "Open")
table(dec.open$AMHS)
I was checking the output and noticed a difference
2006 Sep 28
2
recode problem - unexplained values
I am hoping for some advice regarding the difficulties I have been having
recoding variables which are contained in a csv file. Table 1 (below)
shows there are two types of blanks - as reported in the first two
columns. I am using windows XP & the latets version of R.
When blanks cells are replaced with a value of n using syntax: > affect
[affect==""] <- "n"
there