Compare commits

...

11 Commits

Author SHA1 Message Date
Craig Oates 6a99724322 create manc-rent-average-feb-2024.png file. 2 months ago
Craig Oates 58c4edb89c create manc-rent-average-feb-2024.html file. 2 months ago
Craig Oates ca9b1a701b create manc-avg-rent-feb-2024.csv file. 2 months ago
Craig Oates 38e6deef25 create summary-manchester.org file. 2 months ago
Craig Oates 686a277d97 create ideal-flatmate-rent-manc.png file. 2 months ago
Craig Oates 05f342c08e create ideal-flatmate-rent-manc.html file. 2 months ago
Craig Oates 8435a0b71c adjust header name in ideal-flatmate-manc.csv file. 2 months ago
Craig Oates f2c0f9b152 add explore and summary data to ideal-flatmate-manchester.org file. 2 months ago
Craig Oates 5fbfb7ae26 add total, min. and max. data to spare-room-manchester.org file. 2 months ago
Craig Oates c193a0bdcf delete uk-min-wage.org file. 2 months ago
Craig Oates 0005e808cf create uk-wage-tax.org file. 2 months ago
  1. 168
      ideal-flatmate-manchester.org
  2. 10
      renders/2024-02-24-ideal-flatmate-rent-manc.html
  3. BIN
      renders/2024-02-24-ideal-flatmate-rent-manc.png
  4. 10
      renders/manc-rent-averages-feb-2024.html
  5. BIN
      renders/manc-rent-averages-feb-2024.png
  6. 85
      spare-room-manchester.org
  7. 94
      summary-manchester.org
  8. 15
      uk-wage-tax.org
  9. 2
      working-data/2024-02-24-ideal-flatmate-manc.csv
  10. 5
      working-data/manc-avg-rent-feb-2024.csv

168
ideal-flatmate-manchester.org

@ -95,7 +95,7 @@ end of the day (at time of commit) and need to get some sleep.
:direction :output
:if-exists :supersede)
(let ((row-id 0))
(format out-stream "ROW-ID,RAW-LISTING-INFO,RENT (£),LOCATION,URL~%")
(format out-stream "ROW-ID,RAW-LISTING-INFO,RENT,LOCATION,URL~%")
(loop for file-path
in (directory #P"raw-data/external/2024-02-24_ideal-flatmate-manc-listings/*.html")
do (with-open-file (in-stream file-path)
@ -104,7 +104,7 @@ end of the day (at time of commit) and need to get some sleep.
(cleaned-price (first (cl-ppcre:all-matches-as-strings "\\d+" (first (str:split "room" (aref listing 0))))))
(cleaned-location (str:replace-all "," "" (second (str:split "room" (aref listing 0)))))
(url (lquery:$ doc "a" (attr "href"))))
(format out-stream "~a,~s,~a,~a,~a~%"
(format out-stream "~d,~s,~d,~a,~a~%"
row-id
(aref listing 0)
cleaned-price
@ -120,34 +120,156 @@ basically show all them here.
csvlook working-data/2024-02-24-ideal-flatmate-manc.csv
#+end_src
#+NAME: im-manc-2024-02-24
#+RESULTS:
| ROW-ID | RAW-LISTING-INFO | RENT (£) | LOCATION | URL |
|--------+---------------------------------------------------------------------+----------+----------------------------------------------+-------------------------------------------------------------------------|
| 0 | £690/month per roomChapel Street, Salford M3 5DZ, UK | 690 | Chapel Street Salford M3 5DZ UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id113377 |
| 1 | £740/month per roomChapel Street, Salford M3 5DZ, UK | 740 | Chapel Street Salford M3 5DZ UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id113378 |
| 2 | £841 - £842/month per roomMiddlewood Street, Salford, M5 4YW, UK | 841 | Middlewood Street Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120130 |
| 3 | £746 - £750/month per roomSalford, M5 4ZF, UK | 746 | Salford M5 4ZF UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id122936 |
| 4 | £200/month 100, 100 Lloyd Mansions, Salford M6 6HA, UK | 200 | NIL | https://www.idealflatmate.co.uk/spare-room/salford/property-id122970 |
| 5 | £488/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK | 488 | Joshua Grange Pluto Cl Salford M6 6HF UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id122929 |
| 6 | £580/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK | 580 | Joshua Grange Pluto Cl Salford M6 6HF UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id123025 |
| 7 | £480/month per roomGreater Manchester, Manchester, M31 4HZ, 296, UK | 480 | Greater Manchester Manchester M31 4HZ 296 UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id122962 |
| 8 | £580/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK | 580 | Joshua Grange Pluto Cl Salford M6 6HF UK | https://www.idealflatmate.co.uk/auth/signup?f=b&uid=242365&pid=123025 |
| 9 | £480/month per roomGreater Manchester, Manchester, M31 4HZ, 296, UK | 480 | Greater Manchester Manchester M31 4HZ 296 UK | https://www.idealflatmate.co.uk/auth/signup?f=b&uid=210168&pid=122962 |
| 10 | £850/month per room7 Symphony Park, Manchester M1 7GB, UK | 850 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121033 |
| 11 | £850/month per room7 Symphony Park, Manchester M1 7GB, UK | 850 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121032 |
| 12 | £956 - £957/month per room7 Symphony Park, Manchester M1 7GB, UK | 956 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121034 |
| 13 | £980/month per room7 Symphony Park, Manchester M1 7GB, UK | 980 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121030 |
| 14 | £678 - £679/month per roomSalford M5 4YW, UK | 678 | Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120131 |
| 15 | £708 - £709/month per roomSalford M5 4YW, UK | 708 | Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120127 |
| 16 | £725/month per roomSalford M5 4YW, UK | 725 | Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120128 |
| 17 | £775/month per roomMiddlewood Street, Salford, M5 4YW, UK | 775 | Middlewood Street Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120129 |
| ROW-ID | RAW-LISTING-INFO | RENT | LOCATION | URL |
| ------ | ------------------------------------------------------------------- | ---- | -------------------------------------------- | ----------------------------------------------------------------------- |
| 0 | £690/month per roomChapel Street, Salford M3 5DZ, UK | 690 | Chapel Street Salford M3 5DZ UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id113377 |
| 1 | £740/month per roomChapel Street, Salford M3 5DZ, UK | 740 | Chapel Street Salford M3 5DZ UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id113378 |
| 2 | £841 - £842/month per roomMiddlewood Street, Salford, M5 4YW, UK | 841 | Middlewood Street Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120130 |
| 3 | £746 - £750/month per roomSalford, M5 4ZF, UK | 746 | Salford M5 4ZF UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id122936 |
| 4 | £200/month 100, 100 Lloyd Mansions, Salford M6 6HA, UK | 200 | NIL | https://www.idealflatmate.co.uk/spare-room/salford/property-id122970 |
| 5 | £488/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK | 488 | Joshua Grange Pluto Cl Salford M6 6HF UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id122929 |
| 6 | £580/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK | 580 | Joshua Grange Pluto Cl Salford M6 6HF UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id123025 |
| 7 | £480/month per roomGreater Manchester, Manchester, M31 4HZ, 296, UK | 480 | Greater Manchester Manchester M31 4HZ 296 UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id122962 |
| 8 | £580/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK | 580 | Joshua Grange Pluto Cl Salford M6 6HF UK | https://www.idealflatmate.co.uk/auth/signup?f=b&uid=242365&pid=123025 |
| 9 | £480/month per roomGreater Manchester, Manchester, M31 4HZ, 296, UK | 480 | Greater Manchester Manchester M31 4HZ 296 UK | https://www.idealflatmate.co.uk/auth/signup?f=b&uid=210168&pid=122962 |
| 10 | £850/month per room7 Symphony Park, Manchester M1 7GB, UK | 850 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121033 |
| 11 | £850/month per room7 Symphony Park, Manchester M1 7GB, UK | 850 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121032 |
| 12 | £956 - £957/month per room7 Symphony Park, Manchester M1 7GB, UK | 956 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121034 |
| 13 | £980/month per room7 Symphony Park, Manchester M1 7GB, UK | 980 | 7 Symphony Park Manchester M1 7GB UK | https://www.idealflatmate.co.uk/spare-room/manchester/property-id121030 |
| 14 | £678 - £679/month per roomSalford M5 4YW, UK | 678 | Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120131 |
| 15 | £708 - £709/month per roomSalford M5 4YW, UK | 708 | Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120127 |
| 16 | £725/month per roomSalford M5 4YW, UK | 725 | Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120128 |
| 17 | £775/month per roomMiddlewood Street, Salford, M5 4YW, UK | 775 | Middlewood Street Salford M5 4YW UK | https://www.idealflatmate.co.uk/spare-room/salford/property-id120129 |
- Min. Rent: £480
- Max. Rent: £956
As you can see, all the entries are listed =/month=. So, I've not bothered to
create a /frequency/ column. I'm just going to move forward with that as the
default.
*Note:* There are a could of entries in the =URL= column which have valid URL's but
There are a could of entries in the =URL= column which have valid URL's but
point to the incorrect page on the website. I'm just going to leave them in and
manually go to their listings page on the website. There isn't enough incorrect
URL's to fix this in code. On top of that, I'm more interested in the average
rent price per month than the actual locations right now.
* Explore CSV Data for Ideal Flatmate (2024-02-24)
The listing, in [[im-manc-2024-02-24][the table]] listed above, with the =ROW-ID= of =4=, has rent
advertised at =£200/month=. This looked quite a bit off to the other
listings. So, I did a quick check and this is a *student-only* listing. Thus,
I'm going to remove it from the data, in an attempt to stop the average/mean
from being skewed.
#+begin_src lisp :session
; This is without the student-only listing removed.
(lisp-stat:defdf *im-manc*
(lisp-stat:read-csv #P"working-data/2024-02-24-ideal-flatmate-manc.csv"))
#+end_src
#+RESULTS:
: #<DATA-FRAME:DATA-FRAME (18 observations of 5 variables)>
#+begin_src lisp :session
;; Removed the student listing.
(lisp-stat:defdf *im-manc-filt*
(lisp-stat:filter-rows *im-manc* '(> rent 201)))
#+end_src
#+RESULTS:
: #<DATA-FRAME:DATA-FRAME (17 observations of 5 variables)>
#+begin_src lisp :session :results file
(vega:defplot monthly-rents
`(:title "Rent Rates for Manchester on Ideal Flatmate (24/02/2024)"
:width 600
:height 600
:data ,*im-manc-filt*
:layer #((:mark (:type :bar)
:encoding (:x (:field :row-id :title "Assigned Id." :type :nominal :axis ("labelAngle" 0))
:y (:field :rent :title "Rent (£)" :type :quantitative)
:tooltip (:field :rent)))
(:mark (:type rule :color "darkorange" :size 3)
:encoding (:y (:field :rent :type :quantitative :aggregate :average)
:tooltip (:field :rent :type :quantitative :aggregate :average))))))
(vega:write-html monthly-rents "renders/2024-02-24-ideal-flatmate-rent-manc.html")
#+end_src
#+RESULTS:
[[file:renders/2024-02-24-ideal-flatmate-rent-manc.html]]
[[file:./renders/2024-02-24-ideal-flatmate-rent-manc.png]]
#+begin_src lisp :results output raw
(format t "Mean Rent: £~a" (float (lisp-stat:mean *im-manc-filt*:rent)))
#+end_src
#+RESULTS:
Mean Rent: £714.5294
* Summary of Ideal Flatmate Data
#+begin_src calc :results output
714.52 * 12
#+end_src
#+RESULTS:
: 8574.24
Based on the average rent (inc. bill) for Ideal Flatmate, I would need to make
about £9000/yr. This is just to cover living expenses. Up to now, I've been
adding £5000 on top of that to cover travel, food, clothing and socialising
costs.
#+begin_src calc :results output
9000 + 5000
#+end_src
#+RESULTS:
: 14000
#+begin_src calc :result output
5000 / 12
#+end_src
#+RESULTS:
: 416.666666667
Based on the tax rates (see [[file:./uk-wage-tax.org][UK Wage and Tax Rates]]), the Personal Allowance is
£12,570.
#+begin_src lisp :results output raw
(let* ((earning-target 14000)
(p-allow 12570)
(taxable-income (- earning-target p-allow))
(tax-to-pay (* taxable-income 0.8))
(total (- earning-target tax-to-pay)))
(format t "- Annual Target Salary: £~a~%" earning-target)
(format t "- Part of Salary which is Taxable: £~a~%" taxable-income)
(format t "- Tax to Pay: £~a~%" tax-to-pay)
(format t "- Salary After Tax: £~a~%" total))
#+end_src
#+RESULTS:
- Annual Target Salary: £14000
- Part of Salary which is Taxable: £1430
- Tax to Pay: £1144.0
- Salary After Tax: £12856.0
| Time Span | Value After Tax (£) | Mean Rent (£) |
|-----------------------+---------------------+---------------|
| Annually | 12856 | 714.52 |
| Monthly (Before Rent) | 1071.3333 | |
| Monthly (After Rent) | 356.8133 | |
| Weekly (After Rent) | 89.203325 | |
| Daily (After Rent) | 12.743332 | |
#+TBLFM: @3$2=@-1/12::@4$2=@-1-@-2$+1::@5$2=@-1/4::@6$2=@-1/7
The spending limit of £12.74/day is, pretty much, on par with the assessment of
the [[file:./spare-room-manchester.org][Spare Room]] listings: not great. And, at the time of writing, I've not taken
into account the Income Tax with the Spare Room figures. Granted the difference
won't be that different because the annual earnings are too low, for the most
part (falling out of the Basic Rate band).

10
renders/2024-02-24-ideal-flatmate-rent-manc.html

@ -0,0 +1,10 @@
<html><head><style>html{
height: 100%;
}
html body{
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}</style><script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vega@5'></script><script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vega-lite@5'></script><script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vega-embed@6'></script></head><body><div id='vis'></div><script>var spec = {"data":{"values":[{"rowId":17,"rawListingInfo":"£775/month per roomMiddlewood Street, Salford, M5 4YW, UK","rent":775,"location":"Middlewood Street Salford M5 4YW UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id120129"},{"rowId":16,"rawListingInfo":"£725/month per roomSalford M5 4YW, UK","rent":725,"location":"Salford M5 4YW UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id120128"},{"rowId":15,"rawListingInfo":"£708 - £709/month per roomSalford M5 4YW, UK","rent":708,"location":"Salford M5 4YW UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id120127"},{"rowId":14,"rawListingInfo":"£678 - £679/month per roomSalford M5 4YW, UK","rent":678,"location":"Salford M5 4YW UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id120131"},{"rowId":13,"rawListingInfo":"£980/month per room7 Symphony Park, Manchester M1 7GB, UK","rent":980,"location":"7 Symphony Park Manchester M1 7GB UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id121030"},{"rowId":12,"rawListingInfo":"£956 - £957/month per room7 Symphony Park, Manchester M1 7GB, UK","rent":956,"location":"7 Symphony Park Manchester M1 7GB UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id121034"},{"rowId":11,"rawListingInfo":"£850/month per room7 Symphony Park, Manchester M1 7GB, UK","rent":850,"location":"7 Symphony Park Manchester M1 7GB UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id121032"},{"rowId":10,"rawListingInfo":"£850/month per room7 Symphony Park, Manchester M1 7GB, UK","rent":850,"location":"7 Symphony Park Manchester M1 7GB UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id121033"},{"rowId":9,"rawListingInfo":"£480/month per roomGreater Manchester, Manchester, M31 4HZ, 296, UK","rent":480,"location":"Greater Manchester Manchester M31 4HZ 296 UK","url":"https://www.idealflatmate.co.uk/auth/signup?f=b&uid=210168&pid=122962"},{"rowId":8,"rawListingInfo":"£580/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK","rent":580,"location":"Joshua Grange Pluto Cl Salford M6 6HF UK","url":"https://www.idealflatmate.co.uk/auth/signup?f=b&uid=242365&pid=123025"},{"rowId":7,"rawListingInfo":"£480/month per roomGreater Manchester, Manchester, M31 4HZ, 296, UK","rent":480,"location":"Greater Manchester Manchester M31 4HZ 296 UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id122962"},{"rowId":6,"rawListingInfo":"£580/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK","rent":580,"location":"Joshua Grange Pluto Cl Salford M6 6HF UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id123025"},{"rowId":5,"rawListingInfo":"£488/month per roomJoshua Grange, Pluto Cl, Salford M6 6HF, UK","rent":488,"location":"Joshua Grange Pluto Cl Salford M6 6HF UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id122929"},{"rowId":3,"rawListingInfo":"£746 - £750/month per roomSalford, M5 4ZF, UK","rent":746,"location":"Salford M5 4ZF UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id122936"},{"rowId":2,"rawListingInfo":"£841 - £842/month per roomMiddlewood Street, Salford, M5 4YW, UK","rent":841,"location":"Middlewood Street Salford M5 4YW UK","url":"https://www.idealflatmate.co.uk/spare-room/salford/property-id120130"},{"rowId":1,"rawListingInfo":"£740/month per roomChapel Street, Salford M3 5DZ, UK","rent":740,"location":"Chapel Street Salford M3 5DZ UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id113378"},{"rowId":0,"rawListingInfo":"£690/month per roomChapel Street, Salford M3 5DZ, UK","rent":690,"location":"Chapel Street Salford M3 5DZ UK","url":"https://www.idealflatmate.co.uk/spare-room/manchester/property-id113377"}]},"$schema":"https://vega.github.io/schema/vega-lite/v5.json","title":"Rent Rates for Manchester on Ideal Flatmate (24/02/2024)","width":600,"height":600,"layer":[{"mark":{"type":"bar"},"encoding":{"x":{"field":"rowId","title":"Assigned Id.","type":"nominal","axis":{"labelAngle":0}},"y":{"field":"rent","title":"Rent (£)","type":"quantitative"},"tooltip":{"field":"rent"}}},{"mark":{"type":"rule","color":"darkorange","size":3},"encoding":{"y":{"field":"rent","type":"quantitative","aggregate":"average"},"tooltip":{"field":"rent","type":"quantitative","aggregate":"average"}}}]}; vegaEmbed("#vis", spec).then(result => console.log(result)).catch(console.warn);</script></body></html>

BIN
renders/2024-02-24-ideal-flatmate-rent-manc.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

10
renders/manc-rent-averages-feb-2024.html

@ -0,0 +1,10 @@
<html><head><style>html{
height: 100%;
}
html body{
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}</style><script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vega@5'></script><script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vega-lite@5'></script><script type='text/javascript' src='https://cdn.jsdelivr.net/npm/vega-embed@6'></script></head><body><div id='vis'></div><script>var spec = {"data":{"values":[{"xAxis":"Ideal Flatmate","yAxis":714},{"xAxis":"Spare Room","yAxis":589},{"xAxis":"Right Move","yAxis":1204}]},"$schema":"https://vega.github.io/schema/vega-lite/v5.json","title":"Average Rent Rates Manchester Feb. 2024","mark":"bar","width":600,"height":600,"encoding":{"x":{"field":"xAxis","title":"Company","type":"nominal","axis":{"labelAngle":0}},"y":{"field":"yAxis","title":"Rent Average (£)","type":"quantitative"},"tooltip":{"field":"yAxis"}}}; vegaEmbed("#vis", spec).then(result => console.log(result)).catch(console.warn);</script></body></html>

BIN
renders/manc-rent-averages-feb-2024.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

85
spare-room-manchester.org

@ -219,6 +219,9 @@ it manually because to save time.
#+RESULTS:
: #<DATA-FRAME:DATA-FRAME (1096 observations of 9 variables)>
The 1096 entries is a little to big to put into a bar chart. I'm going to skip
this and look at the data in just tables and use the data-frame outputs.
** Filter Results for Weekly and Monthly Rent (and Bills Inc.)
The data in the CSV file includes both weekly and monthly rent rates. I need to
@ -271,7 +274,7 @@ any changes made in this file.
#+end_src
#+RESULTS:
: #<DATA-FRAME:DATA-FRAME (67 observations of 9 variables)>
: #<DATA-FRAME:DATA-FRAME (63 observations of 9 variables)>
#+begin_src lisp :session
(lisp-stat:defdf *sr-manc-mth*
@ -279,7 +282,9 @@ any changes made in this file.
#+end_src
#+RESULTS:
: #<DATA-FRAME:DATA-FRAME (585 observations of 9 variables)>
: #<DATA-FRAME:DATA-FRAME (584 observations of 9 variables)>
Total number of listings being used,
#+begin_src lisp :results output raw
(let* ((wk (lisp-stat:mean *sr-manc-wk*:price))
@ -325,7 +330,36 @@ going to take advantage of the tiny amount of data needed and input it manually.
[[file:renders/2024-02-23-spare-room-average-rent-diffs.png]]
* Summary of Spare Room Data
* Summary of Spare Room Data (Not Inc. Income Tax)
#+begin_src lisp :results raw
(lisp-stat:summarize-column '*sr-manc-mth*:price)
#+end_src
#+RESULTS:
584 reals, min=300, q25=547.6666, q50=599.8028, q75=657.125, max=1260
#+begin_src lisp :results raw
(lisp-stat:summarize-column '*sr-manc-wk*:price)
#+end_src
#+RESULTS:
63 reals, min=110, q25=141.7857, q50=153, q75=162.75, max=167
#+begin_src lisp :results output raw
(format t "- Total Listings: ~a~%" (+ 584 63))
(format t "- Week Min. Adjusted to Month: ~a~%" (* 110 4))
(format t "- Week Max. Adjusted to Month: ~a" (* 167 4))
#+end_src
#+RESULTS:
- Total Listings: 647
- Week Min. Adjusted to Month: 440
- Week Max. Adjusted to Month: 668
| Total Listing Used | Min. (£) | Max. (£) |
|--------------------+----------+----------|
| 647 | 300 | 1260 |
The average rent (including bills) between the weekly and monthly listings
(23/02/2024),
@ -350,7 +384,7 @@ probably looking at £13,000/yr to keep me going, at a basic level.
#+begin_src lisp :results output raw
(let* ((ann (float (+ 7100 5000)))
(mth (float (/ ann 12)))
;; Hardcoded rent price because it's quicker and easier to do that here. asdfs
;; Hardcoded rent price because it's quicker and easier to do that here.
(wk (float (/ (- mth 589.24) 4)))
(day (float (/ wk 7))))
(format t "|Time Span|Value (£)|~%")
@ -375,6 +409,45 @@ which are lower. Unfortunately, I don't feel comfortable thinking I have a
buffer zone here. From here on out, I'm going to treat these values as the
lowest I can go.
I could do with going over the [[file:./uk-min-wage.org][minimum wage stuff]] for the UK, to see how far off
these numbers are.
I could do with going over the [[file:./uk-wage-tax.org][minimum wage and tax stuff]] for the UK, to see how
far off these numbers are.
* Recalulate Figures with Income Tax
Having gone through the number in [[file:./ideal-flatmate-manchester.org][Ideal Flatmate (Manc.)]], I realised I haven't
taken into account the Income Tax with the figures above. I realise the
difference won't be that big because the annual salary target, used above,
barely passes the Personal Allowance band (Income Tax).
#+begin_src lisp :results output raw
(let* ((earning-target 12100)
(p-allow 12570)
(taxable-income (- p-allow earning-target))
(tax-to-pay (* taxable-income 0.8))
(total (- earning-target tax-to-pay)))
(format t "- Annual Target Salary: £~a~%" earning-target)
(format t "- Part of Salary which is Taxable: £~a~%" taxable-income)
(format t "- Tax to Pay: £~a~%" tax-to-pay)
(format t "- Salary After Tax: £~a~%" total))
#+end_src
#+RESULTS:
- Annual Target Salary: £12100
- Part of Salary which is Taxable: £470
- Tax to Pay: £376.0
- Salary After Tax: £11724.0
| Time Span | Value After Tax (£) | Mean Rent (£) |
|-----------------------+---------------------+---------------|
| Annually | 11724 | 589.24 |
| Monthly (Before Rent) | 977 | |
| Monthly (After Rent) | 387.76 | |
| Weekly (After Rent) | 96.94 | |
| Daily (After Rent) | 13.848571 | |
#+TBLFM: @3$2=@-1/12::@4$2=@-1-@-2$+1::@5$2=@-1/4::@6$2=@-1/7
The recalculation, with Income Tax, changes my spend limit to £13.85/day. It's
not a massive drop from £14.96, but it's not helping the situation. I should
point out here, these figures use the bare minimum salary target (I've set for
myself) of £12,100. Realistically, I'm going have to go with the £13,000 I
mentioned in section [[Summary of Spare Room Data (Not Inc. Income Tax)]] above.

94
summary-manchester.org

@ -0,0 +1,94 @@
#+options: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline author:t
#+options: broken-links:nil c:nil creator:nil d:(not "LOGBOOK") date:t e:t
#+options: email:nil expand-links:t f:t inline:t num:t p:nil pri:nil prop:nil
#+options: stat:t tags:t tasks:t tex:t timestamp:t title:t toc:t todo:t |:t
#+title: Summary Manchester
#+date: \today
#+author: Craig Oates
#+email: craig@craigoates.net
#+language: en
#+select_tags: export
#+exclude_tags: noexport
#+creator: Emacs 29.1.90 (Org mode 9.7-pre)
#+cite_export:
* Setup Common Lisp Environment
You will not need to execute this code block if you've already set up SLIME in
another ORG file. This is just in case this is the only file you're working on
today, or it's your first file of the day.
*Run ~m-x slime~ before running the following code.* And, make note of the
~:session~ attribute. It allows you to use the code in the code block to be use
in other code blocks which also use the ~:session~ attribute.
#+begin_src lisp :session :results silent
(ql:quickload :com.inuoe.jzon) ; JSON parser.
(ql:quickload :dexador) ; HTTP requests.
(ql:quickload :plump) ; HTML/XML parser.
(ql:quickload :lquery) ; HTML/DOM manipulation.
(ql:quickload :lparallel) ; Parallel programming.
(ql:quickload :cl-ppcre) ; RegEx. library.
(ql:quickload :plot/vega) ; Vega plotting library.
(ql:quickload :lisp-stat) ; Stat's library.
(ql:quickload :data-frame) ; Data frame library eqv. to Python's Numpy.
(ql:quickload :str) ; String library, expands on 'string' library.
#+end_src
* Rent Summary
I should point out here, the prices have deliberately removed overly expensive
listings. They are unrealistic to my personal living conditions in 2024. So, the
data relayed below is not a complete reflection of the companies/sources listed
within it.
This table will be added to over time, as I work my way through more
website/companies. I've decided to copy them over from the files holding said
information. It's just easier to do so because of how small the data is. Coding
this up would take to long, for little gain.
#+NAME: manc-avg-rent
| Company | Quantity | Avg-Rent | Search-Range | Min-Rent | Max-Rent |
|----------------+----------+----------+--------------+----------+----------|
| Right Move | 121 | 1204 | £275–£1500 | 945 | 1495 |
| Spare Room | 647 | 589 | £100–£1260 | 300 | 1260 |
| Ideal Flatmate | 17 | 714 | £200–£1200 | 480 | 956 |
| | | | | | |
#+begin_src lisp :var table=manc-avg-rent :results output raw
(let ((filepath #P"working-data/manc-avg-rent-feb-2024.csv"))
(with-open-file (stream
filepath
:direction :output
:if-exists :supersede)
;; This needs to be added manually because of the use '|--+--|' in the table
;; above. If the table's header changes, you will need to updated here, as
;; well. It's a bit of pain but it is what it is.
(format stream "Company,Quantity,Avg-Rent,Search-Range,Min-Rent,Max-Rent~%")
(dolist (row table)
(format stream "~{~a~^,~}~%" row)))
(format t "[[file:~a]]" filepath))
#+end_src
#+RESULTS:
[[file:working-data/manc-avg-rent-feb-2024.csv]]
#+begin_src lisp :results file
(let* ((values (lisp-stat:plist-df `(:x-axis #("Right Move" "Spare Room" "Ideal Flatmate")
:y-axis #(1204 589 714)))))
(vega:defplot manc-avg-rent
`(:title "Average Rent Rates Manchester Feb. 2024"
:mark :bar
:width 600
:height 600
:data ,values
:encoding (:x (:field :x-axis :title "Company" :type :nominal :axis ("labelAngle" 0))
:y (:field :y-axis :title "Rent Average (£)" :type :quantitative)
:tooltip (:field :y-axis))))
(vega:write-html manc-avg-rent "renders/manc-rent-averages-feb-2024.html"))
#+end_src
#+RESULTS:
[[file:renders/manc-rent-averages-feb-2024.html]]
[[file:./renders/manc-rent-averages-feb-2024.png]]

15
uk-min-wage.org → uk-wage-tax.org

@ -2,7 +2,7 @@
#+options: broken-links:nil c:nil creator:nil d:(not "LOGBOOK") date:t e:t
#+options: email:nil expand-links:t f:t inline:t num:t p:nil pri:nil prop:nil
#+options: stat:t tags:t tasks:t tex:t timestamp:t title:t toc:t todo:t |:t
#+title: UK Min. Wage
#+title: UK Wage and Tax Rates
#+date: \today
#+author: Craig Oates
#+email: craig@craigoates.net
@ -12,7 +12,7 @@
#+creator: Emacs 29.1.90 (Org mode 9.7-pre)
#+cite_export:
* Overview of UK Minimum/Living Wage
* Overview of UK Minimum/Living Wage and Tax Rates
- [[https://www.gov.uk/national-minimum-wage-rates][UK National Minimum/Living Wage Rates]]
@ -44,3 +44,14 @@ dealing with the 'Over 21' rates.
*Note:* These figures don't take into account holiday/sick pay. These figures are
just to give me a ballpark figure of what the UK government considers the bare
minimum one should expect to earn in the UK from April 2024.
* Income Tax Rates (upto 5th April 2024)
- [[https://www.gov.uk/income-tax-rates][UK Income Tax Rates]]
| Band | Taxable income | Tax rate |
|--------------------+---------------------+----------|
| Personal Allowance | Up to £12,570 | 0% |
| Basic rate | £12,571 to £50,270 | 20% |
| Higher rate | £50,271 to £125,140 | 40% |
| Additional rate | over £125,140 | 45% |

2
working-data/2024-02-24-ideal-flatmate-manc.csv

@ -1,4 +1,4 @@
ROW-ID,RAW-LISTING-INFO,RENT (£),LOCATION,URL
ROW-ID,RAW-LISTING-INFO,RENT,LOCATION,URL
0,"£690/month per roomChapel Street, Salford M3 5DZ, UK",690,Chapel Street Salford M3 5DZ UK,https://www.idealflatmate.co.uk/spare-room/manchester/property-id113377
1,"£740/month per roomChapel Street, Salford M3 5DZ, UK",740,Chapel Street Salford M3 5DZ UK,https://www.idealflatmate.co.uk/spare-room/manchester/property-id113378
2,"£841 - £842/month per roomMiddlewood Street, Salford, M5 4YW, UK",841,Middlewood Street Salford M5 4YW UK,https://www.idealflatmate.co.uk/spare-room/salford/property-id120130

1 ROW-ID RAW-LISTING-INFO RENT (£) RENT LOCATION URL
2 0 £690/month per roomChapel Street, Salford M3 5DZ, UK 690 Chapel Street Salford M3 5DZ UK https://www.idealflatmate.co.uk/spare-room/manchester/property-id113377
3 1 £740/month per roomChapel Street, Salford M3 5DZ, UK 740 Chapel Street Salford M3 5DZ UK https://www.idealflatmate.co.uk/spare-room/manchester/property-id113378
4 2 £841 - £842/month per roomMiddlewood Street, Salford, M5 4YW, UK 841 Middlewood Street Salford M5 4YW UK https://www.idealflatmate.co.uk/spare-room/salford/property-id120130

5
working-data/manc-avg-rent-feb-2024.csv

@ -0,0 +1,5 @@
Company,Quantity,Avg-Rent,Search-Range,Min-Rent,Max-Rent
Right Move,121,1204,£275–£1500,945,1495
Spare Room,647,589,£100–£1260,300,1260
Ideal Flatmate,17,714,£200–£1200,480,956
,,,,,
1 Company Quantity Avg-Rent Search-Range Min-Rent Max-Rent
2 Right Move 121 1204 £275–£1500 945 1495
3 Spare Room 647 589 £100–£1260 300 1260
4 Ideal Flatmate 17 714 £200–£1200 480 956
5
Loading…
Cancel
Save